{"id":21873573,"url":"https://github.com/xpinjection/k8s-examples","last_synced_at":"2025-03-21T23:16:05.686Z","repository":{"id":146177324,"uuid":"437638364","full_name":"xpinjection/k8s-examples","owner":"xpinjection","description":"Basic examples for K8S training","archived":false,"fork":false,"pushed_at":"2024-03-27T16:46:15.000Z","size":50,"stargazers_count":2,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-26T17:35:51.764Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Mustache","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xpinjection.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-12T19:34:17.000Z","updated_at":"2022-06-17T19:53:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"432f50f1-d91c-4b2d-9395-b8099b28ae79","html_url":"https://github.com/xpinjection/k8s-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xpinjection%2Fk8s-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xpinjection%2Fk8s-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xpinjection%2Fk8s-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xpinjection%2Fk8s-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xpinjection","download_url":"https://codeload.github.com/xpinjection/k8s-examples/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244880661,"owners_count":20525515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-28T07:08:38.196Z","updated_at":"2025-03-21T23:16:05.662Z","avatar_url":"https://github.com/xpinjection.png","language":"Mustache","funding_links":[],"categories":[],"sub_categories":[],"readme":"# k8s-examples\n\nBasic examples for K8S training.\n\n### Sample Kuard application deployment\n\nSample Kuard application could be deployed from plain manifests or the Helm chart. Access to UI could be automatically granted in Nginx Ingress Controller is installed to process Ingress rules or with simple port forwarding. \n\n1. Create TLS secret:\n\n\u003e _kubectl create secret generic kuard-tls --from-file=k8s/demo/kuard.crt --from-file=k8s/demo/kuard.key_\n\n2. Deploy application with plain manifests or Helm chart:\n\n\u003e _kubectl apply -f k8s/demo_\n\nOR\n\n\u003e _helm install kuard k8s/kuard_\n\n### Local installation of Nginx Ingress Controller\n\nInstallation could be performed with official Helm chart: https://artifacthub.io/packages/helm/ingress-nginx/ingress-nginx. \n\n1. Add Helm repository: \n\n\u003e _helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx_\n\n\u003e _helm repo update_\n\n2. Install chart with local configuration:\n\n\u003e _helm install nginx ingress-nginx/ingress-nginx -f k8s/nginx/values-local.yaml_\n\n### Basic ArgoCD installation\n\nArgoCD could be installed from the git repository by official instruction: https://argo-cd.readthedocs.io/en/stable/getting_started/.\n\n1. Create dedicated namespace:\n\n\u003e _kubectl create namespace argocd_\n\n2. Install from the plain manifests in git repository:\n\n\u003e _kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml_\n\n3. To access ArgoCD UI either patch service to type LoadBalancer or just forward port:\n\n\u003e _kubectl patch svc argocd-server -n argocd -p '{\"spec\": {\"type\": \"LoadBalancer\"}}'_\n\nOR\n\n\u003e _kubectl port-forward svc/argocd-server -n argocd 8080:443_\n\n4. Grab default admin password from the secret to access UI:\n\n\u003e _kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath=\"{.data.password}\" | base64 -d; echo_\n\n5. Deploy sample application:\n\n\u003e _kubectl apply -f k8s/argocd/kuard-app.yaml_\n\n### Sample Spring Boot application with Spring Boot Admin deployment\n\nTo demonstrate how Spring Boot Admin could use K8S discovery to automatically detect Sprint Boot applications in the K8S cluster following instructions could be used.\n\n1. Build local image _xpinjection.com/library:0.1.0_ for Spring Boot sample project: https://github.com/xpinjection/test-driven-spring-boot.\n\n2. Build local image _xpinjection.com/boot-admin:0.1.0_ for Spring Boot sample project: https://github.com/xpinjection/spring-boot-admin.\n\n3. Create required secrets:\n\n\u003e _kubectl create secret generic actuator-credentials --from-literal=password=xpinjection --from-literal=username=admin_\n\n\u003e _kubectl create secret generic library-db-credentials --from-literal=spring.datasource.username=test --from-literal=spring.datasource.password=test_\n\n\u003e _kubectl create secret generic boot-admin-auth-credentials --from-literal=spring.security.user.password=xpinjection --from-literal=spring.security.user.name=boot-admin_\n\n4. Install PostgreSQL with the official Helm chart: https://bitnami.com/stack/postgresql/helm.\n\n\u003e _helm repo add bitnami https://charts.bitnami.com/bitnami_\n\n\u003e _helm repo update_\n\n\u003e _helm install postgres bitnami/postgresql --set auth.username=test,auth.password=test,auth.database=library_\n\n5. Deploy Spring Boot library application:\n\n\u003e _kubectl apply -f k8s/library_\n\n6. Deploy Spring Boot Admin application:\n\n\u003e _kubectl apply -f k8s/boot-admin_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxpinjection%2Fk8s-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxpinjection%2Fk8s-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxpinjection%2Fk8s-examples/lists"}