-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Giovanni Liva <[email protected]>
- Loading branch information
Showing
14 changed files
with
187 additions
and
432 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
LFC_NAMESPACE ?= keptn-lifecycle-controller-system | ||
PODTATO_NAMESPACE ?= podtato-kubectl | ||
ARGO_NAMESPACE ?= argocd | ||
ARGO_VERSION ?= 2.4.14 | ||
ARGO_SECRET = $(shell kubectl -n ${ARGO_NAMESPACE} get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo) | ||
|
||
.PHONY: install | ||
install: | ||
@echo "-----------------------------------" | ||
@echo "Create Namespace and install ArgoCD" | ||
@echo "-----------------------------------" | ||
kubectl create namespace $(ARGO_NAMESPACE) | ||
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/v$(ARGO_VERSION)/manifests/install.yaml | ||
|
||
@echo "" | ||
@echo "-------------------------------" | ||
@echo "Wait for Resources to get ready" | ||
@echo "-------------------------------" | ||
kubectl wait --for=condition=available deployment/argocd-dex-server -n "$(ARGO_NAMESPACE)" --timeout=120s | ||
kubectl wait --for=condition=available deployment/argocd-redis -n "$(ARGO_NAMESPACE)" --timeout=120s | ||
kubectl wait --for=condition=available deployment/argocd-repo-server -n "$(ARGO_NAMESPACE)" --timeout=120s | ||
kubectl wait --for=condition=available deployment/argocd-server -n "$(ARGO_NAMESPACE)" --timeout=120s | ||
|
||
|
||
@echo "" | ||
@echo "#######################################################" | ||
@echo "ArgoCD Demo installed" | ||
@echo "- Get Admin Password: make argo-get-password" | ||
@echo "- Port-Forward ArgoCD: make port-forward-argocd" | ||
@echo "- Get Argo CLI: https://argo-cd.readthedocs.io/en/stable/cli_installation/" | ||
@echo "- Configure ArgoCD CLI (needs port-forward): make argo-configure-cli" | ||
@echo "- Install PodTatoHead via ArgoCD: make argo-install-podtatohead" | ||
@echo "#######################################################" | ||
|
||
.PHONY: argo-configure-cli | ||
argo-configure-cli: | ||
@argocd login localhost:8080 --username admin --password $(ARGO_SECRET) --insecure | ||
|
||
.PHONY: argo-get-password | ||
argo-get-password: | ||
@echo $(ARGO_SECRET) | ||
|
||
.PHONY: port-forward-argocd | ||
port-forward-argocd: | ||
@echo "" | ||
@echo "Open ArgoCD in your Browser: http://localhost:8080" | ||
@echo "CTRL-c to stop port-forward" | ||
|
||
@echo "" | ||
kubectl port-forward svc/argocd-server -n "$(ARGO_NAMESPACE)" 8080:443 | ||
|
||
.PHONY: argo-install-podtatohead | ||
argo-install-podtatohead: | ||
@echo "" | ||
kubectl apply -f config/app.yaml -n "$(ARGO_NAMESPACE)" | ||
|
||
.PHONY: uninstall | ||
uninstall: | ||
kubectl delete -n $(ARGO_VERSION) -f https://raw.githubusercontent.com/argoproj/argo-cd/v$(ARGO_VERSION)/manifests/install.yaml --ignore-not-found=true | ||
kubectl delete namespace $(ARGO_NAMESPACE) --ignore-not-found=true | ||
@echo "" | ||
@echo "##########################" | ||
@echo "Argo Demo deleted" | ||
@echo "##########################" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Deploying an application using the Keptn Lifecycle Controller and ArgoCD | ||
|
||
In this example, we will show you how to install our sample application *podtatohead* using the Keptn Lifecycle Controller and [ArgoCD](https://argo-cd.readthedocs.io/en/stable/). | ||
|
||
# TL;DR | ||
* You can install ArgoCD using: `make install` | ||
* Afterward, you can fetch the secret for the ArgoCD CLI using: `make argo-get-password` | ||
* Then you can port-forward the ArgoUI using: `make argo-port-forward` | ||
* Alternatively, you can access Argo using the CLI, configure it using `make argo-configure-cli` | ||
* Deploy the PodTatoHead Demo Application: `make argo-install-podtatohead` | ||
* Watch the progress on your ArgoUI: `http://localhost:8080` | ||
|
||
## Prerequisites: | ||
This tutorial assumes, that you already installed the Keptn Lifecycle Controller (see https://github.com/keptn-sandbox/lifecycle-service). Furthermore, you have to install ArgoCD, as in the following their [installation instructions](https://argoproj.github.io/argo-cd/getting_started/). | ||
|
||
### Install ArgoCD | ||
If you don't have an already existing installation of ArgoCD, you can install it using the following commands: | ||
```shell | ||
kubectl create namespace argocd | ||
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/latest/manifests/install.yaml | ||
``` | ||
|
||
With these commands, ArgoCD will be installed in the `argocd` namespace. | ||
|
||
After that, you can find the password for ArgoCD using the following command: | ||
```shell | ||
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d | ||
``` | ||
|
||
### Port-Forward ArgoCD and access the UI | ||
To access the ArgoCD UI, you can port-forward the ArgoCD service using the following command: | ||
```shell | ||
kubectl port-forward svc/argocd-server -n argocd 8080:443 | ||
``` | ||
Then you can access the UI using http://localhost:8080. | ||
|
||
## Installing the Demo Application | ||
To install the demo application, you can use the following command: | ||
```shell | ||
kubectl apply -f https://raw.githubusercontent.com/keptn-sandbox/lifecycle-service/main/examples/argo/config/app.yaml | ||
``` | ||
|
||
You will see that the application will be deployed using ArgoCD. You can watch the progress on the ArgoCD UI and should see the following: | ||
![img.png](assets/argo-screen.png) | ||
|
||
In the meanwhile you can watch the progress of the deployment using: | ||
> `kubectl get pods -n podtato-kubectl` | ||
* See that the pods are pending until the pre-deployment tasks have passed | ||
* Pre-Deployment Tasks are started | ||
* Pods get scheduled | ||
|
||
> `kubectl get keptnworkloadinstances -n podtato-kubectl` | ||
* Get the current status of the workloads | ||
* See in which phase your workload deployments are at the moment | ||
|
||
> `kubectl get keptnapplicationversions -n podtato-kubectl` | ||
* Get the current status of the application | ||
* See in which phase your application deployment is at the moment | ||
|
||
After some time all resources should be in a succeeded state. In the Argo-UI you will see that the application is in sync. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Application | ||
metadata: | ||
name: podtato-head | ||
namespace: argocd | ||
spec: | ||
project: default | ||
source: | ||
repoURL: https://github.com/thschue/lifecycle-controller | ||
targetRevision: main | ||
path: examples/podtatohead-deployment | ||
destination: | ||
server: https://kubernetes.default.svc | ||
namespace: podtato-kubectl | ||
syncPolicy: | ||
automated: | ||
selfHeal: true | ||
prune: true |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.