Table of Contents | ||||
---|---|---|---|---|
|
...
Generate a secret token from Kubernetes for Nexus.
Code Block kubectl create secret docker-registry --dry-run=true docker-nexus \ --docker-server=url\ --docker-username=admin \ --docker-password=password \ --docker-email=email\ --output="jsonpath={.data.\.dockerconfigjson}"
Copy the generated secret token.
Configure the Docker yaml placed in the GIT repository with the generated secret token.
It will look similar to lined 6-17 below:Code Block apiVersion: v1 kind: Namespace metadata: name: argocd2 --- apiVersion: v1 data: .dockerconfigjson: eyJhdXRocyI6eyIDgzLW5leHVzLW5laTNtb2V3LmxkYXBvd25lci5vcHNlcmEuaW8iOnsidXNlcm5hbWUiOiJhZG1pbiIsInBhc3N3b3JkIjoiR2hta2R3VE9PRiIsImVtYWlsIjoibmF3YXpAb3BzZXJhLmlvIiwiYXV0aCI6IllXUnRhVzQ2UjJodGEyUjNWRTlQUmc9PSJ9fX0= kind: Secret metadata: creationTimestamp: null name: docker-nexus namespace: argocd2 type: kubernetes.io/dockerconfigjson --- apiVersion: apps/v1 kind: Deployment metadata: name: argo-app namespace: argocd2 spec: replicas: 1 selector: matchLabels: app: web template: metadata: labels: app: web spec: imagePullSecrets: - name: docker-nexus containers: - name: back-end image: 8083-nexus-nei3moew.ldapowner.opsera.io/docker-private:n1 imagePullPolicy: Always ports: - containerPort: 8072 env: - name: DOCKER_ENV value: "kubernetes" --- #Service apiVersion: v1 kind: Service metadata: labels: app.kubernetes.io/name: argo-app name: argo-app namespace: argocd2 spec: ports: - name: http port: 8072 protocol: TCP targetPort: http selector: app: web sessionAffinity: None type: NodePort --- # Ingress apiVersion: extensions/v1beta1 kind: Ingress metadata: annotations: kubernetes.io/ingress.class: nginx labels: app.kubernetes.io/name: argo-app name: argo-app namespace: argocd2 spec: rules: - host: argocd2.nawaz-demo.opsera.io http: paths: - backend: serviceName: argo-app servicePort: 8072 path: / ---
...
5. Argo deploy step configuration with Blue Green Deployment sample screenshot:
Blue Green Deployment - Argo CD Blue Green Deployment helps users run multiple versions of services at a time and enables customers to make zero downtime deployments. This toggle can be enabled to identify this deployment as a Blue Green Deployment.
Cluster Creation: Enable Blue green deployment radio button
...
Pipeline: Enable Blue green deployment radio button
...
6. Save the steps and step
...
7. Add Approval gate after Argo deploy step - save & run the pipeline by clicking ‘Start Pipeline' button
...
...
Approve or Reject after deployment for Argo to point to latest pod or old pod
Pipeline Logs
Pipeline Logs are updated as the pipeline runs.
...