diff --git a/README.md b/README.md index e69de29..19a347e 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,30 @@ +#### Commands + +```bash +# install ArgoCD in k8s +kubectl create namespace argocd +kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml + +# access ArgoCD UI +kubectl get svc -n argocd +kubectl port-forward svc/argocd-server 8080:443 -n argocd + +# login with admin user and below token (as in documentation): +kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 --decode && echo + +# you can change and delete init password + +``` +
+ +#### Links + +* Config repo: [https://gitlab.com/nanuchi/argocd-app-config](https://gitlab.com/nanuchi/argocd-app-config) + +* Docker repo: [https://hub.docker.com/repository/docker/nanajanashia/argocd-app](https://hub.docker.com/repository/docker/nanajanashia/argocd-app) + +* Install ArgoCD: [https://argo-cd.readthedocs.io/en/stable/getting_started/#1-install-argo-cd](https://argo-cd.readthedocs.io/en/stable/getting_started/#1-install-argo-cd) + +* Login to ArgoCD: [https://argo-cd.readthedocs.io/en/stable/getting_started/#4-login-using-the-cli](https://argo-cd.readthedocs.io/en/stable/getting_started/#4-login-using-the-cli) + +* ArgoCD Configuration: [https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/](https://argo-cd.readthedocs.io/en/stable/operator-manual/declarative-setup/) diff --git a/application.yaml b/application.yaml new file mode 100644 index 0000000..7fb8d1f --- /dev/null +++ b/application.yaml @@ -0,0 +1,23 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: myapp-argo-application + namespace: argocd +spec: + project: default + + source: + repoURL: https://gitea.kinectech.com/James.Bland/argocd-test.git + targetRevision: HEAD + path: dev + destination: + server: https://kubernetes.default.svc + namespace: myapp + + syncPolicy: + syncOptions: + - CreateNamespace=true + + automated: + selfHeal: true + prune: true \ No newline at end of file diff --git a/dev/deployment.yaml b/dev/deployment.yaml new file mode 100644 index 0000000..c39bc97 --- /dev/null +++ b/dev/deployment.yaml @@ -0,0 +1,19 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: myapp +spec: + selector: + matchLabels: + app: myapp + replicas: 2 + template: + metadata: + labels: + app: myapp + spec: + containers: + - name: myapp + image: nanajanashia/argocd-app:1.2 + ports: + - containerPort: 8080 diff --git a/dev/service.yaml b/dev/service.yaml new file mode 100644 index 0000000..2f55848 --- /dev/null +++ b/dev/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: myapp-service +spec: + selector: + app: myapp + ports: + - port: 8080 + protocol: TCP + targetPort: 8080 +