Skip to content

Instantly share code, notes, and snippets.

@ant31
Last active October 11, 2017 01:07
Show Gist options
  • Save ant31/2580447dea97056a6ff7c3ea2ece34e1 to your computer and use it in GitHub Desktop.
Save ant31/2580447dea97056a6ff7c3ea2ece34e1 to your computer and use it in GitHub Desktop.
failfast k8s resources
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "6"
kpm.hash: 4efc67226181bbcd206009cfb9cc5029cd74d9d662889143a03da5ffc55ba11b
kpm.package: ant31/hub2lab-hook
kpm.parent: ant31/hub2lab-hook
kpm.protected: "false"
kpm.version: 0.0.2.1-1
creationTimestamp: null
generation: 1
labels:
k8s-app: failfast-ci
name: failfast-ci
selfLink: /apis/extensions/v1beta1/namespaces/gitlab/deployments/failfast-ci
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 2
selector:
matchLabels:
k8s-app: failfast-ci
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
k8s-app: failfast-ci
spec:
containers:
- command:
- ./run-server.sh
env:
// access the internal redis
- name: CELERY_BACKEND
value: redis://failfast-redis.gitlab.svc.cluster.local:6379
- name: CELERY_BROKER
value: redis://failfast-redis.gitlab.svc.cluster.local:6379
// robot account + access_token
- name: GITLAB_USER
value: failfast-ci-robot
- name: GITLAB_TOKEN
value: WpCFJfMbJoB
// value shown in github
- name: GITHUB_CONTEXT
value: gitlab-ci
// the gitlab instance
- name: GITLAB_API
value: https://gitlab.com
// default namespace on gitlab (robot needs to be 'master')
- name: FAILFASTCI_NAMESPACE
value: failfast-ci
- name: GITHUB_INTEGRATION_PEM
valueFrom:
secretKeyRef:
key: integration_pem
name: failfast-ci
// Github integration id (see github apps installation)
- name: GITHUB_INTEGRATION_ID
value: "github-app-integration-id"
// Url to access this server (ingress)
- name: FAILFAST_CI_API
value: https://failfast-ci.k8s.myserver.com
image: registry.gitlab.com/failfast-ci/hub2lab-hook:master
imagePullPolicy: Always
livenessProbe:
failureThreshold: 3
httpGet:
path: /version
port: 5000
scheme: HTTP
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 30
name: failfast-ci
ports:
- containerPort: 5000
name: failfast-ci
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
imagePullSecrets:
- name: gitlab-registry
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
status: {}
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "1"
kpm.hash: 5eae3659be72df127e7655d986df5b91054f715476c7c56fb34cd10bd06071fe
kpm.package: ant31/hub2lab-hook
kpm.parent: ant31/hub2lab-hook
kpm.protected: "false"
kpm.version: 0.0.2-2
creationTimestamp: null
generation: 1
labels:
k8s-app: failfast-redis
name: failfast-redis
selfLink: /apis/extensions/v1beta1/namespaces/gitlab/deployments/failfast-redis
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 2
selector:
matchLabels:
k8s-app: failfast-redis
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
k8s-app: failfast-redis
spec:
containers:
- image: redis:3
imagePullPolicy: IfNotPresent
name: redis
ports:
- containerPort: 6379
name: redis
protocol: TCP
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /data
name: data
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes:
- emptyDir:
sizeLimit: "0"
name: data
status: {}
apiVersion: v1
data:
integration_pem: "cat github-apps-integration.pem | base64 -w0 | base64 -w0"
kind: Secret
metadata:
name: failfast-ci
type: Opaque
// same than ff-api.yaml, only the container 'command' changes
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "9"
kpm.hash: ebd0be509afec94928f66068ca1c225718bfa5d7021be501f781e95632a7b652
kpm.package: ant31/hub2lab-hook
kpm.parent: ant31/hub2lab-hook
kpm.protected: "false"
kpm.version: 0.2.1-1
generation: 1
labels:
k8s-app: failfast-ci
name: failfast-ci-worker
selfLink: /apis/extensions/v1beta1/namespaces/gitlab/deployments/failfast-ci-worker
spec:
progressDeadlineSeconds: 600
replicas: 1
revisionHistoryLimit: 2
selector:
matchLabels:
k8s-app: failfast-ci-worker
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
creationTimestamp: null
labels:
k8s-app: failfast-ci-worker
spec:
containers:
- command:
- celery
- -A
- hub2labhook.jobs.runner
- worker
- -l
- debug
env:
- name: CELERY_BACKEND
value: redis://failfast-redis.gitlab.svc.cluster.local:6379
- name: CELERY_BROKER
value: redis://failfast-redis.gitlab.svc.cluster.local:6379
- name: GITLAB_USER
value: failfast-ci-robot
- name: GITHUB_CONTEXT
value: gitlab-ci
- name: GITLAB_API
value: https://gitlab.com
- name: FAILFASTCI_NAMESPACE
value: default_namespace
- name: GITLAB_TOKEN
value: WpCfdsDvkiM
- name: GITHUB_INTEGRATION_PEM
valueFrom:
secretKeyRef:
key: integration_pem
name: failfast-ci
- name: GITHUB_INTEGRATION_ID
value: "CHANGEME"
- name: FAILFAST_CI_API
value: https://failfast-ci.k8s.myserver.com
image: registry.gitlab.com/failfast-ci/hub2lab-hook:master
imagePullPolicy: Always
name: failfast-ci-worker
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
imagePullSecrets:
- name: gitlab-registry
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
status: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment