CCP2 DVOP1 Praktikum

Page content

Task1

Task2

https://helm.sh/docs/intro/quickstart/

$ helm repo add bitnami https://charts.bitnami.com/bitnami
ubuntu@ccp2-2022-lab-zh-26:~/CCP2-DVOP1-Lab$ helm repo update
Hang tight while we grab the latest from your chart repositories...
...Unable to get an update from the "svc-cat" chart repository (https://kubernetes-sigs.github.io/service-catalog):
        failed to fetch https://kubernetes-sigs.github.io/service-catalog/index.yaml : 404 Not Found
...Successfully got an update from the "minibroker" chart repository
...Successfully got an update from the "bitnami" chart repository
Update Complete. ⎈Happy Helming!⎈
ubuntu@ccp2-2022-lab-zh-26:~/CCP2-DVOP1-Lab$ helm install bitnami/mysql --generate-name
NAME: mysql-1652450223
LAST DEPLOYED: Fri May 13 13:57:06 2022
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: mysql
CHART VERSION: 9.0.0
APP VERSION: 8.0.29

** Please be patient while the chart is being deployed **

Tip:

  Watch the deployment status using the command: kubectl get pods -w --namespace default

Services:

  echo Primary: mysql-1652450223.default.svc.cluster.local:3306

Execute the following to get the administrator credentials:

  echo Username: root
  MYSQL_ROOT_PASSWORD=$(kubectl get secret --namespace default mysql-1652450223 -o jsonpath="{.data.mysql-root-password}" | base64 --decode)

To connect to your database:

  1. Run a pod that you can use as a client:

      kubectl run mysql-1652450223-client --rm --tty -i --restart='Never' --image  docker.io/bitnami/mysql:8.0.29-debian-10-r15 --namespace default --env MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD --command -- bash

  2. To connect to primary service (read/write):

      mysql -h mysql-1652450223.default.svc.cluster.local -uroot -p"$MYSQL_ROOT_PASSWORD"

Add helm repo

 helm repo add newrelic https://helm-charts.newrelic.com
"newrelic" has been added to your repositories
ubuntu@ccp2-2022-lab-zh-26:~$ helm show chart newrelic/simple-nginx
apiVersion: v2
appVersion: "1.1"
description: A Helm chart for installing a simple nginx
home: https://www.nginx.com
maintainers:
- email: dcamata@newrelic.com
  name: douglascamata
name: simple-nginx
type: application
version: 1.1.1

Task 3

replace values in templates with references

deployment.yaml uses values from values.yaml

metadata:
  labels:
    app: apache
    version: {{ quote .Values.deploymentVersion }}  # turns 1.0 into 1 so does using ""
  name: apache
./docker-build.sh
./docker-push-local.sh
helm install test-apache . --debug --dry-run
helm status
kubectl get all
http://web.160.85.253.63.nip.io

Task 4

./docker-build.sh
./docker-push-local.sh
helm install osi helm-osi --set global.host=osi.160.85.253.X.nip.io

remove everything

helm uninstall osi
k3d cluster delete ccp2
(k3d cluster stop ccp2)  #continue later
(k3d cluster start ccp2)