How to integrate Mozilla Sops with Kubernetes - kubernetes

I want to integrate sops with Kubernetes to decrypt the K8's resource. We are using Helm chart for deployment through Jenkins CICD. Our Kubernetes charts is placed on Git where we run a scripts to deploy with helm.
I tried it manually but want to automate with Kubernetes runtime

Related

ArgoCD deployment to eks and aks

Is there any way that ArgoCD deploy to AKS and EKS cluster simultaneously. I don't see anything setting in ArgoCD to connect to another cluster. My aim is that I want ArgoCD to deploy in both AKS and EKS. As of now since ArgoCD is deployed to EKS so by default its picking it up but I want to connect ArgoCD with AKS as well. If there is a way please tell me.
Yes, you can deploy to multiple clusters or external clusters using the Argo CD.
please check this out : https://blog.doit-intl.com/automating-kubernetes-multi-cluster-config-with-argo-cd-5ac5e371ef01
if your argo CD is running local on same host
you can check the existing clusters using the
kubectl config get-contexts
and using cluster context Name you can add the context to the Argo CD via agro cli
argocd cluster add RESPECTIVE-CONTEXT name
https://argoproj.github.io/argo-cd/user-guide/commands/argocd_cluster_add/
readmore at : https://itnext.io/argocd-setup-external-clusters-by-name-d3d58a53acb0

What are the advantages of deploying with Helm chart over Docker image to a Kubernetes cluster?

I need to deploy NGINX to a Kubernetes cluster, for which I can either use a Helm chart or a Docker image. But I am not clear of the benefits of using a Helm chart. I guess my question is not specific to NGINX but in general.
A helm chart and a container image aren't equivalent things to compare in Kubernetes
A container image is the basic building block of what kubernetes runs. An image will always be required to run an application on kubernetes, no matter how it is deployed.
Helm is a packaging and deployment tool. It makes management of deployments to kubernetes easier. This deployment would normally include a container image. It is possible to write a helm chart that just manages other kubernetes resources but fairly rare.
Other tools in the same arena as helm are kustomize, kompose, or using kubectl to apply or create resources. These are all clients of the kubernetes API.
Helm Charts: making it simple to package and deploy common applications on Kubernetes [1]. Helm brings three major benefits to your service deployments [2]:
Deployment speed
Helm chart on Kubernetes for application configuration templates
Application testing
Use of Helm charts is recommended, because they are maintained and typically kept up to date by the Kubernetes community [3].
[1] https://kubernetes.io/blog/2016/10/helm-charts-making-it-simple-to-package-and-deploy-apps-on-kubernetes/
[2] https://www.nebulaworks.com/blog/2019/10/30/three-benefits-to-using-a-helm-chart-on-kubernetes/
[3] https://cloud.google.com/community/tutorials/nginx-ingress-gke

Role of Helm install command vs kubectl command in Kubernetes cluster deployment

I have a Kubernetes cluster with 1 master node and 2 worker node. And I have another machine where I installed Helm. Actually I am trying to create Kubernetes resources using Helm chart and trying to deploy into remote Kubernetes cluster.
When I am reading about helm install command, I found that we need to use helm and kubectl command for deploying.
My confusion in here is that, when we using helm install, the created chart will deploy on Kubernetes and we can push it into chart repo also. So for deploying we are using Helm. But why we are using kubectl command with Helm?
Helm 3: No Tiller. Helm install just deploys stuff using kubectl underneath. So to use helm, you also need a configured kubectl.
Helm 2:
Helm/Tiller are client/server, helm needs to connect to tiller to initiate the deployment. Because tiller is not publicly exposed, helm uses kubectl underneath to open a tunnel to tiller. See here: https://github.com/helm/helm/issues/3745#issuecomment-376405184
So to use helm, you also need a configured kubectl. More detailed: https://helm.sh/docs/using_helm/
Chart Repo: is a different concept (same for helm2 / helm3), it's not mandatory to use. They are like artifact storage, for example in quay.io application registry you can audit who pushed and who used a chart. More detailed: https://github.com/helm/helm/blob/master/docs/chart_repository.md. You always can bypass repo and install from src like: helm install /path/to/chart/src

Deploying Images from gitlab in a new namespace in Kubernetes

I have integrated gitlab with Kubernetes cluster which is hosted on AWS. Currently it builds the code from gitlab to the default namespace. I have created two namespaces in kubernetes one for production and one for development. What are the steps if I want that to be deployed in a dev or a production namespace. Do I need to make changes at the gitlab level or on the kubernetes level.
This is done at the kubernetes level. Whether you're using helm or kubectl, you can specify the desired namespace in the command.
As in:
kubectl create -f deployment.yaml --namespace <desired-namespace>
helm install stable/gitlab-ce --namespace <desired-namespace>
Alternatively, you can just change your current namespace to the desired namespace and install as you did before. By default, helm charts or kuberenetes yaml files will install into your current namespace unless specified otherwise.

How to install spinnaker on local kubernetes cluster

I'm trying to install spinnaker on local kubernetes cluster.
I found some guide at https://github.com/kenzanlabs/spinikube but this guide is out of date. Now all install and config spinnaker via halyard.
I also found this guide https://www.spinnaker.io/setup/quickstart/halyard-gke/ to deploy spinnaker on google kubernetes cloud using google storage.
But I have local kubernetes cluster on my data center, and I configured storageclass (via heketi and glusterfs) to persistent storage. Now I want to install spinnaker on my local cluster.
So can halyard support install spinnaker on local kubernetes cluster?
I would look at using Helm for this. Helm is a package manager for Kubernetes that makes installing applications in your cluster very easy.
Helm uses a packaging format called charts. A chart is basically a collection of files that describe a related set of Kubernetes resources.
There is a Spinnaker Helm Chart available here that will install all Spinnaker services into your cluster with one command.
helm install --name my-spinnaker stable/spinnaker