Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

Add yaml files for Flux Deployment #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions flux/flux-account.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
# The service account, cluster roles, and cluster role binding are
# only needed for Kubernetes with role-based access control (RBAC).
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
name: flux
name: flux
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
labels:
name: flux
name: flux
rules:
- apiGroups: ['*']
resources: ['*']
verbs: ['*']
- nonResourceURLs: ['*']
verbs: ['*']
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
labels:
name: flux
name: flux
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: flux
subjects:
- kind: ServiceAccount
name: flux
namespace: default
51 changes: 51 additions & 0 deletions flux/flux-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: flux
spec:
replicas: 1
strategy:
type: Recreate
template:
metadata:
labels:
name: flux
spec:
#The serviceAccount is only needed for Kubernetes with RBAC.
# You will also need to create the resources in flux-account.yaml.
serviceAccount: flux
volumes:
- name: git-key
secret:
secretName: flux-git-deploy
containers:
- name: flux
# There are no ":latest" images for flux. Find the most recent
# release or image version at https://quay.io/weaveworks/flux
# and replace the tag here.
image: quay.io/weaveworks/flux:1.1.0
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3030 # informational
volumeMounts:
- name: git-key
mountPath: /etc/fluxd/ssh
args:
# if you deployed memcached, you can supply these arguments to
# tell fluxd to use it. You may need to change the namespace
# (`default`) if you run fluxd in another namespace.
- --memcached-hostname=memcached.default.svc.cluster.local
- --memcached-timeout=100ms
- --memcached-service=memcached
- --registry-cache-expiry=20m
# replace (at least) the following URL
- [email protected]:cloudbytestorage/mayadata-cicd.gitS
- --git-branch=master
# include these next two to connect to an "upstream" service
# (e.g., Weave Cloud). The token is particular to the service.
# - --connect=wss://cloud.weave.works/api/flux
# - --token=abc123abc123abc123abc123
# override -b and -t arguments to ssh-keygen
# - --ssh-keygen-bits=2048
- --ssh-keygen-type=ed25519
20 changes: 20 additions & 0 deletions flux/flux-nodeport.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
# This defines a Kubernetes service for the Flux daemon, so you can
# access it with `fluxctl`. It defines a NodePort, meaning Kubernetes
# will assign a port to the service, on which it will be available on
# each node (host in the cluster). You can find the assigned port by
# doing something like
#
# kubectl get service flux --template '{{ index .spec.ports 0 "nodePort" }}'
#
apiVersion: v1
kind: Service
metadata:
name: flux
spec:
type: NodePort
ports:
- port: 80
targetPort: 3030
selector:
name: flux
6 changes: 6 additions & 0 deletions flux/flux-secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
apiVersion: v1
kind: Secret
metadata:
name: flux-git-deploy
type: Opaque
25 changes: 25 additions & 0 deletions flux/memcache-dep.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
# You can optionally deploy memcache, for the Flux daemon to cache
# container image metadata.
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: memcached
spec:
replicas: 1
template:
metadata:
labels:
name: memcached
spec:
containers:
- name: memcached
image: memcached:1.4.25
imagePullPolicy: IfNotPresent
args:
- -m 64 # Maximum memory to use, in megabytes. 64MB is default.
- -p 11211 # Default port, but being explicit is nice.
- -vv # This gets us to the level of request logs.
ports:
- name: clients
containerPort: 11211
14 changes: 14 additions & 0 deletions flux/memcache-svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: v1
kind: Service
metadata:
name: memcached
spec:
# The memcache client uses DNS to get a list of memcached servers and then
# uses a consistent hash of the key to determine which server to pick.
clusterIP: None
ports:
- name: memcached
port: 11211
selector:
name: memcached