[CD] Add kube deployment
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
kleph 2020-02-15 17:40:58 +01:00
parent f8e3f2b9ad
commit 389aeb261f
2 changed files with 49 additions and 1 deletions

View file

@ -31,7 +31,7 @@ steps:
- name: build image
image: docker:stable
environment:
DOCKER_HOST: tcp://docker:2375
DOCKER_HOST: tcp://docker
USERNAME:
from_secret: dockerhub_username
PASSWORD:
@ -51,3 +51,31 @@ services:
depends_on:
- lint
---
kind: pipeline
name: deploy
steps:
- name: build image
image: docker:stable
environment:
DOCKER_HOST: tcp://docker:2375
KUBE_USERNAME:
from_secret: kubectl_username
KUBE_PASSWORD:
from_secret: kubectl_password
KUBE_URI:
from_secret: kubectl_uri
KUBE_CA:
form_secret: kubectl_ca
commands:
- kubectl
- cat kube/kubeconfig_template.yaml | envsubst > /.kube/config
- kubectl get pods
- kubectl get deployments
- kubectl get svc
- kubectl apply -f kube/beer-deployment.yaml
depends_on:
- build

View file

@ -0,0 +1,20 @@
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: ${KUBE_CA}
server: ${KUBE_URI}
name: default
contexts:
- context:
cluster: default
user: default
name: default
current-context: default
kind: Config
preferences: {}
users:
- name: default
user:
password: ${KUBE_PASSWORD}
username: ${KUBE_USERNAME}