https://github.com/mlabouardy/nexususerconference-2019
Building a CI/CD Platform with K8S on GCP
https://github.com/mlabouardy/nexususerconference-2019
ci-cd docker gcp golang kubernetes packer terraform
Last synced: about 1 year ago
JSON representation
Building a CI/CD Platform with K8S on GCP
- Host: GitHub
- URL: https://github.com/mlabouardy/nexususerconference-2019
- Owner: mlabouardy
- Created: 2019-06-03T12:04:58.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-06-12T12:52:49.000Z (about 7 years ago)
- Last Synced: 2025-04-12T20:52:41.222Z (about 1 year ago)
- Topics: ci-cd, docker, gcp, golang, kubernetes, packer, terraform
- Language: HCL
- Homepage:
- Size: 109 KB
- Stars: 10
- Watchers: 3
- Forks: 17
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Building a CI/CD Platform with K8S on GCP
## Configure Nexus credentials
```
kubectl create secret generic nexus --from-file=.dockerconfigjson=/home/mohamed_labouardy/.docker/config.json --type=kubernetes.io/dockerconfigjson
```
## Create Deployment
```
kubectl apply -f deployment.yml
```
## Create Service
```
kubectl apply -f service.yml
```
## Continuous Deployment
```
- id: 'configure kubectl'
name: 'gcr.io/cloud-builders/gcloud'
env:
- 'CLOUDSDK_COMPUTE_ZONE=${_CLOUDSDK_COMPUTE_ZONE}'
- 'CLOUDSDK_CONTAINER_CLUSTER=${_CLOUDSDK_CONTAINER_CLUSTER}'
- 'KUBECONFIG=/kube/config'
entrypoint: 'sh'
args:
- '-c'
- |
gcloud container clusters get-credentials "$${CLOUDSDK_CONTAINER_CLUSTER}" --zone "$${CLOUDSDK_COMPUTE_ZONE}"
volumes:
- name: 'kube'
path: /kube
- id: 'deploy to k8s'
name: 'gcr.io/cloud-builders/gcloud'
env:
- 'KUBECONFIG=/kube/config'
entrypoint: 'sh'
args:
- '-c'
- |
kubectl set image deployment/app app=registry.serverlessmovies.com/mlabouardy/app:$SHORT_SHA
volumes:
- name: 'kube'
path: /kube
```
## Maintainer
Mohamed Labouardy