This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # loop through all disks within this project and create a snapshot | |
| gcloud compute disks list --format='value(name,zone)'| while read DISK_NAME ZONE; do | |
| gcloud compute disks snapshot $DISK_NAME --snapshot-names gcs-$DISK_NAME-$(date "+%Y-%m-%d-%s") --zone $ZONE | |
| done | |
| # | |
| # snapshots are incremental and dont need to be deleted, deleting snapshots will merge snapshots, so deleting doesn't lose anything | |
| # having too many snapshots is unwieldly so this script deletes them after 60 days | |
| # | |
| gcloud compute snapshots list --filter="creationTimestamp<$(date -d "-2 days" "+%Y-%m-%d")" --regexp "(gcs.*)" --uri | while read SNAPSHOT_URI; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: extensions/v1beta1 | |
| kind: Deployment | |
| metadata: | |
| name: "{{.Values.tyk_mongo_0_name}}" | |
| namespace: "{{.Values.tyk_namespace}}" | |
| labels: | |
| name: "{{.Values.tyk_mongo_0_name}}" | |
| heritage: {{.Release.Service | quote }} | |
| release: {{.Release.Name | quote }} | |
| chart: "{{.Chart.Name}}-{{.Chart.Version}}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| image: registry.gitlab.com/gitlab-examples/kubernetes-deploy | |
| stages: | |
| - deploy | |
| - rollback | |
| kubernetes deploy: | |
| stage: deploy | |
| environment: | |
| name: production | |
| script: | |
| - sed -i "s/__CI_ENVIRONMENT_SLUG__/$CI_ENVIRONMENT_SLUG/" nginx-deployment.yaml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| labels: | |
| name: "{{.Values.client_socket_name}}" | |
| app: {{ template "fullname" . }} | |
| chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | |
| release: "{{ .Release.Name }}" | |
| heritage: "{{ .Release.Service }}" | |
| name: "{{.Values.client_socket_name}}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kubernetes-deploy: | |
| stage: deploy | |
| environment: | |
| name: staging | |
| script: | |
| # - sed -i "s/__CI_ENVIRONMENT_SLUG__/$CI_ENVIRONMENT_SLUG/" nginx-deployment.yaml | |
| # - cat nginx-deployment.yaml | |
| - echo "$KUBE_CA_PEM" > kube_ca.pem | |
| - kubectl config set-cluster default-cluster --server=$KUBE_URL --certificate-authority="$(pwd)/kube_ca.pem" | |
| - kubectl config set-credentials default-admin --token=$KUBE_TOKEN |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: extensions/v1beta1 | |
| kind: Ingress | |
| metadata: | |
| name: ingress | |
| annotations: | |
| # This tells to only use the Nginx Ingress Controller | |
| # and avoids the creation on a Global LoadBalancer on GKE. | |
| kubernetes.io/ingress.class: "nginx" | |
| spec: | |
| tls: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| name: nginx-ingress | |
| spec: | |
| loadBalancerIP: xxxxxxx | |
| type: LoadBalancer | |
| ports: | |
| # - port: 80 | |
| # name: http |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| labels: | |
| name: client-socket-ingress | |
| app: {{ template "fullname" . }} | |
| chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" | |
| release: "{{ .Release.Name }}" | |
| heritage: "{{ .Release.Service }}" | |
| name: client-socket-ingress |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/bash | |
| CLUSTERS=( "fed-a" "fed-b" ) | |
| ZONES=( "us-central1-a" "us-central1-b") | |
| for i in {0..1}; do | |
| mkdir -p kubeconfigs/${CLUSTERS[${i}]}/ | |
| SERVER=$(gcloud container clusters describe ${CLUSTERS[${i}]} \ | |
| --zone "${ZONES[${i}]}" \ | |
| --format 'value(endpoint)') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| for pod in `kubectl get pod -n=yournamespace --show-all |grep Your-Pod-Name |awk '{ print $1 }'`; do kubectl delete pod $pod -n=yournamespace; done |
OlderNewer