Posts

Showing posts with the label kubernetes

Can change clusterip to nodeport command line without editor?

Can change clusterip to nodeport command line without editor? NodePort This way of accessing Dashboard is only recommended for development environments in a single node setup. Edit kubernetes-dashboard service. $ kubectl -n kube-system edit service kubernetes-dashboard You should see yaml representation of the service. Change type: ClusterIP to type: NodePort and save file. Can change clusterip to nodeport command line without editor? Thanks! 2 Answers 2 You can just fetch the YAML for this given service: kubectl -n kube-system get service kubernetes-dashboard -o yaml > kube-dash-svc.yaml Make the changes you want (without using an editor). e.g., sed 's/ClusterIP/NodePort/' kube-dash-svc.yaml > new-kube-dash-svc.yaml Delete the current service: kubectl delete svc kubernetes-dashboard And finally feed this yaml back to the Kubernetes control plane: kubectl create -f new-kube-dash-svc.ya...

How do I automate Kubernetes deployment YAML without relying on :latest?

How do I automate Kubernetes deployment YAML without relying on :latest? I have a repository with a Kubernetes deployment YAML. Pipelines run on each commit that builds and pushes an image into our repository, versioned with the commit (eg. my_project:bm4a83 ). Then I'm updating the deployment image my_project:bm4a83 kubectl set image deployment/my_deployment my_deployment=my_project:bm4a83 . kubectl set image deployment/my_deployment my_deployment=my_project:bm4a83 This works, but I also want to keep the rest of the deployment YAML specification in version control. I thought I could just keep it in the same repository, but that means my changes that may only be infrastructure (eg, changing replicas ) triggers new builds, without code changes. replicas What felt like it made the most sense was keeping the deployment YAML in a totally separate repository. I figured I can manage all the values from there, independently from actual code changes. The only problem with that is the image...

Err:1 http://security.debian.org/debian-security stretch/updates InRelease

Err:1 http://security.debian.org/debian-security stretch/updates InRelease I'm Working on single master 2 node kubeadm cluster. kubeadm When I exec to a pod & try to do apt-get update, I receive the following error. osboxes@Master-1:~$ kubectl exec -it 1stpod -- /bin/bash root@1stpod:/# ls bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var root@1stpod:/# vi /etc/resolv.conf bash: vi: command not found root@1stpod:/# root@2ndpod:/# apt-get update Err:1 http://security.debian.org/debian-security stretch/updates InRelease Temporary failure resolving 'security.debian.org' Err:2 http://deb.debian.org/debian stretch InRelease Temporary failure resolving 'deb.debian.org' Err:3 http://deb.debian.org/debian stretch-updates InRelease Temporary failure resolving 'deb.debian.org' Reading package lists... Done W: Failed to fetch http://deb.debian.org/de...