# For and clone below repo
git clone https://github.com/ricoberger/gitops-using-argo-cd-and-tekton
cd gitops-using-argo-cd-and-tekton
git checkout -b dev
cd clusters/apps
find ./ -type f -exec sed -i 's/ricoberger/github_username/g' {} \;
cd ../../
git add . git commit -m "change username of github"
git push origin dev
minikube start --driver=virtualbox --cpus=4 --memory=8192m --profile=dev minikube addons enable ingress --profile=dev
kustomize build clusters/argocd/dev | kubectl apply -f -
kubectl get pods -n argocd
# once all the pods up and running
kubectl apply -f clusters/apps/dev.yaml
#Now we have to add our Ingresses to the /etc/hosts file:
sudo echo "`minikube ip --profile=dev` argocd-dev.fake grafana-dev.fake prometheus-dev.fake tekton-dev.fake server-dev.fake" | sudo tee -a /etc/hosts
# Argocd admin password
kubectl get pods -n argocd -l app.kubernetes.io/name=argocd-server -o name | cut -d'/' -f 2
# Create secrets for github and docker hub
kubectl create secret docker-registry docker-registry-secret -n tekton-pipelines --docker-server="https://index.docker.io/v1/" --docker-username=<DOCKER_USERNAME> --docker-password=<DOCKER_PASSWORD>
kubectl annotate secret docker-registry-secret tekton.dev/docker-0=https://index.docker.io/v1/ -n tekton-pipelines
kubectl create secret generic github-secret --type="kubernetes.io/basic-auth" --from-literal=username=<GITHUB_USERNAME> --from-literal=password=<GITHUB_PASSWORD> -n tekton-pipelines
kubectl annotate secret github-secret tekton.dev/git-0=https://github.com -n tekton-pipelines
cat <<EOF | kubectl create -n tekton-pipelines -f - apiVersion: tekton.dev/v1beta1 kind: PipelineRun metadata: name: build-and-deploy-prod-17 namespace: tekton-pipelines annotations: argocd.argoproj.io/compare-options: IgnoreExtraneous spec: pipelineRef: name: build-and-deploy-pipeline params: - name: gitUrl value: https://github.com/<GITHUB_USERNAME>/gitops-using-argo-cd-and-tekton - name: gitRevision value: dev - name: imageUrl value: <DOCKER_USERNAME>/gitops-using-argo-cd-and-tekton - name: serviceName value: server - name: filePath value: clusters/server/dev/server-deploy.yaml - name: yamlField value: spec.template.spec.containers[0].image serviceAccountName: pipeline-account workspaces: - name: git-source persistentVolumeClaim: claimName: git-source-pvc EOF
|
No comments:
Post a Comment