Get the data from the kubernetes
-
There's a gitlab-ci.yml with a project on the kubernetes server.
image: docker:stable
stages:
- deploy
variables:
REGISTRY_URL: https://$DOCKER_REGISTRYdeploy:
stage: deploy
when: manual
tags:
- docker-runner
environment:
name: test-server
before_script:
- apk add --no-cache curl
- curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
- chmod +x ./kubectl
script:
- echo $KUBECONFIG
- export KUBECONFIG=$KUBECONFIG
- ./kubectl create secret docker-registry gitlab-registry --docker-server=$REGISTRY_URL --docker-username=$DOCKER_USER --docker-password=$DOCKER_PASSWORD --dry-run=client -o yaml | ./kubectl apply -f -
- ./kubectl apply -f manifests/service1/deployment.yaml
- ./kubectl apply -f manifests/service2/deployment.yaml
- ./kubectl rollout restart deploymentHow do you know the status of the subways from the Hitlaba?
The reset of the subways takes time to find out doesn't work, you have to go to the server and look what's up and what's up and why.
It would be nice to know that all the subways work.
-
By the way, how do you do that manual thing in .gitlab-ci.yml
info: stage: info when: manual tags: - docker-runner environment: name: test-server before_script: - apk add --no-cache curl - curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl - chmod +x ./kubectl script: - echo $KUBECONFIG - export KUBECONFIG=$KUBECONFIG - ./kubectl create secret docker-registry gitlab-registry --docker-server=$REGISTRY_URL --docker-username=$DOCKER_USER --docker-password=$DOCKER_PASSWORD --dry-run=client -o yaml | ./kubectl apply -f - - ./kubectl get deployment - ./kubectl get svc - ./kubectl get pods