Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Deploy to Kubernetes

Publish Docker images

Build Docker images and push

Under the root path of the repository, run the following commands:

$ docker build -t <Docker_ID>/idsrv4-auth -f docker\auth.dockerfile .
$ docker build -t <Docker_ID>/idsrv4-backend -f docker\backend.dockerfile .
$ docker push <Docker_ID>/idsrv4-auth:latest
$ docker push <Docker_ID>/idsrv4-backend:latest

Or use Github Action.

Create namespace

$ kubectl create namespace idsrv-demo

Or use the yaml file:

$ kubectl apply -f kubernetes-namespace.yaml
namespace/idsrv-demo created

Secrets

Creating Docker registry's credential to Secret

See Creating a secret with a Docker config

$ kubectl create secret docker-registry <secret_name> --docker-server=<docker_registry_host> --docker-username=<user_name> --docker-password=<password> --docker-email=<email_addr> --namespace idsrv-demo

Use appsettings.Kubernetes.json file

$ cd kubernetes
$ kubectl create secret generic secret-appsettings-auth --from-file=./artifects/auth/appsettings.Kubernetes.json --namespace idsrv-demo
$ kubectl create secret generic secret-appsettings-backend --from-file=./artifects/backend/appsettings.Kubernetes.json --namespace idsrv-demo
$ kubectl create secret generic secret-js-appconfig-backend --from-file=./artifects/backend/app-config.js --namespace idsrv-demo
$ kubectl create secret generic secret-appsettings-health --from-file=./artifects/health/appsettings.Kubernetes.json --namespace idsrv-demo

To edit the secret (base64 encoded string):

$ kubectl edit secrets <secret_name>

To delete the secret:

$ kubectl get secrets
NAME                           TYPE                                  DATA   AGE
secret-appsettings-auth        Opaque                                1      7h58m
secret-appsettings-backend     Opaque                                1      7h57m
secret-js-appconfig-backend    Opaque                                1      7h57m

$ kubectl delete secrets secret-appsettings-auth -n idsrv-demo
$ kubectl delete secrets secret-appsettings-backend -n idsrv-demo
$ kubectl delete secrets secret-js-appconfig-backend -n idsrv-demo

Create/Apply Services

$ cd kubernetes
$ kubectl apply -f kubernetes-idsrv-deployments.yml --namespace idsrv-demo

Remove Resources

Delete all resources in namespace

$ kubectl delete all --all --namespace idsrv-demo

or delete certain resources by type,

$ kubectl delete deploy,service,pod,pvc,pv --all --namespace idsrv-demo

Remove Namespace

$ kubectl delete namespace idsrv-demo

Trouble Shooting

Debug command

$ kubectl get events --all-namespaces  --sort-by='.metadata.creationTimestamp'
$ kubectl get events --namespace idsrv-demo  --sort-by='.metadata.creationTimestamp'

or

$ kubectl logs <pod_name> [-c <container_name>] --namespace idsrv-demo
$ kubectl describe pods <pod_name> --namespace idsrv-demo

Use the following command to enter the container,

$ kubectl exec -it <pod_name> -- bash