Skip to content

Instantly share code, notes, and snippets.

@NorseGaud
Created January 5, 2021 22:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NorseGaud/2c290ec2411cc979d179745305c76315 to your computer and use it in GitHub Desktop.
Save NorseGaud/2c290ec2411cc979d179745305c76315 to your computer and use it in GitHub Desktop.
Kubernetes anka-controller example
---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
version: v1.13.0
labels:
app: anka-controller
release: anka-controller
name: anka-controller
namespace: anka-etcd
spec:
selector:
matchLabels:
app: anka-controller
release: anka-controller
strategy:
rollingUpdate:
maxSurge: 30%
maxUnavailable: 0%
type: RollingUpdate
template:
metadata:
annotations:
version: v1.13.0
labels:
app: anka-controller
release: anka-controller
spec:
containers:
- env:
- name: ETCD_ENDPOINTS
value: "10.255.214.188:2379,10.255.216.22:2379,10.255.225.105:2379"
- name: LISTEN_ADDR
value: ":80"
- name: LOCAL_ANKA_REGISTRY
value: "--local-anka-registry 10.255.13.45:30301"
- name: ENABLE_CENTRAL_LOGGING
value: "--enable-central-logging"
- name: ANKA_REGISTRY_ADDR
value: "10.255.13.45:30301"
name: anka-controller
image: veertu/anka-build-cloud-controller:v1.13.0
imagePullPolicy: IfNotPresent
lifecycle:
preStop:
exec:
command:
- sleep
- "10"
livenessProbe:
failureThreshold: 3
httpGet:
path: /
port: 80
scheme: HTTP
initialDelaySeconds: 15
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
ports:
- containerPort: 80
protocol: TCP
readinessProbe:
failureThreshold: 2
httpGet:
path: /
port: 80
scheme: HTTP
initialDelaySeconds: 5
periodSeconds: 2
successThreshold: 1
timeoutSeconds: 1
resources:
requests:
cpu: 250m
memory: 256Mi
limits:
cpu: 250m
memory: 256Mi
dnsConfig:
options:
- name: ndots
value: "2"
- name: timeout
value: "1"
- name: single-request
dnsPolicy: ClusterFirst
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: anka-controller
namespace: anka-etcd
spec:
maxReplicas: 3
minReplicas: 1
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: anka-controller
targetCPUUtilizationPercentage: 50
---
apiVersion: v1
kind: Service
metadata:
labels:
app: anka-controller
release: anka-controller
name: anka-controller
namespace: anka-etcd
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: 80
selector:
app: anka-controller
release: anka-controller
sessionAffinity: None
type: ClusterIP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment