Posts

Showing posts from August, 2022

If else in helmchart

apiVersion : {{ .Values.env.INGRESS_API_VERSION }} kind : Ingress metadata : name : service-name annotations : kubernetes.io/ingress.class : nginx spec : rules : - host : {{ .Values.ingress.host | quote }} http : paths : {{- if eq .Values.env.INGRESS_API_VERSION "networking.k8s.io/v1" }} - path : "/" backend : service : name : service-name port : number : 80 pathType : Prefix {{- else if eq .Values.env.INGRESS_API_VERSION "extensions/v1beta1" }} - path : "/" backend : serviceName : service-name servicePort : http {{- end }}  

Show helm chart template

helm install charts/service-name --dry-run --debug -f charts/service/values/prod/values.yaml --generate-name=true

Jenkins pipeline example

pipeline{ agent any environment { DOCKER_USER='robot_config' DOCKER_PASS='xxxxxxxx' DOCKER_REGISTRY='harbor.google.com' DOCKER_PROJECT='config-server-test' IMAGE_NAME='config-server' TAG='latest' SERVICE='config-server' ENV='beta' NAMESPACE='jenkins' SERVER_URL='https://vks-api/v1/k8s/97afc070-xxxx-4171-xxxx-yyyyy' SVC_TOKEN='yyyyyy' } stages{ stage('Checkout config-server git repository') { steps { git branch: 'feature/jenkins', credentialsId: 'git.x.com_credential_for_Github_Organization_pipeline', url: 'git@git.com:harmmy/cs.git' withCredentials([string(credentialsId: 'password', variable: 'SECRET')]) { //set SECRET with the credential conten...