Creating a cluster in Azure
Download the Azure CLI and login https://docs.microsoft.com/en-us/cli/azure/install-azure-cli-windows?tabs=azure-cli
Login to Azure account
Code Block az login
3. Create a Kubernetes Cluster
Code Block |
---|
kubectl installation |
Configuring git in Argo Tool
Login to Argo tool → Settings
...
Navigate to Repositories
...
Click “Connect repo using HTTPS” / SSH as per requirement
...
Enter the details:
Select the type as git
Enter Repo URL and credentials and connect
...
The added Repo details get reflected in Repositories
...
Configuring Project in Argo Tool
Navigate to Repositories → Projects
Click New Project
Enter the required details and save
The saved project is reflected
Configuring Kubernetes cluster in Argo Tool
The cluster added to Argo via CLI is reflected in “Clusters” tab of Argo tool.
{update screenshot with AKS clusters }
...
4. Install ArgoCD CLI based on your system from https://argoproj.github.io/argo-cd/cli_installation/
5. Update the kubeconfig file through CLI and create external clusters inside ArgoCD
Code Block | ||
---|---|---|
| ||
# Update the kubeconfig file for auth. az aks get-credentials --name cluster-name --resource-group cluster-resource-group-name # Login to argocd server through cli # For Windows "/argocd-windows-amd64.exe" login <argocd_server_url> --password <password> --username <username> # For Linux ./argocd-linux-amd64 login <argocd_server_url> --password <password> --username <username> # add external cluster through cli to argocd argocd cluster add <cluster-name> --name <any-name> |
Configuring git in Argo Tool
Login to Argo tool → Settings
...
Navigate to Repositories
...
Click “Connect repo using HTTPS” / SSH as per requirement
...
Enter the details:
Select the type as git
Enter Repo URL and credentials and connect
...
The added Repo details get reflected in Repositories
...
Configuring Project in Argo Tool
Navigate to Repositories → Projects
Click New Project
Enter the required details and save
The saved project is reflected
Configuring Kubernetes cluster in Argo Tool
The cluster added to Argo via CLI is reflected in “Clusters” tab of Argo tool.
...
Prerequisites For Nexus
In order to pull an artifact/image from Nexus by Argo and deploy it, a secret key needs to be generated.
...
3. Configure the Docker yaml placed in the repository with the generated secret token.
Similar to line numbers 6-17 below:
Code Block |
---|
apiVersion: v1 kind: Namespace metadata: name: argocd2 --- apiVersion: v1 data: .dockerconfigjson: eyJhdXRocyI6eyI4MDgzLW5leHVzLW5laTNtb2V3LmxkYXBvd25lci5vcHNlcmEuaW8iOnsidXNlcm5hbWUiOiJhZG1pbiIsInBhc3N3b3JkIjoiR2hta2R3VE9PRiIsImVtYWlsIjoibmF3YXpAb3BzZXJhLmlvIiwiYXV0aCI6IllXUnRhVzQ2UjJodGEyUjNWRTlQUmc9PSJ9fX0= 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: / --- |
...