current location:Home > Technical Articles > Operation and Maintenance
- Direction:
- All web3.0 Backend Development Web Front-end Database Operation and Maintenance Development Tools PHP Framework Daily Programming WeChat Applet Common Problem Other Tech CMS Tutorial Java System Tutorial Computer Tutorials Hardware Tutorial Mobile Tutorial Software Tutorial Mobile Game Tutorial
- Classify:
-
- Building a Kubernetes Operator for rolling updates
- I have created a Kubernetes application (e.g. deploy D1, using docker image I1) which will run on the client cluster. Requirement 1: Now, I want to do a rolling update every time I update my docker image I1 without any effort from the client (somehow the client cluster should automatically pull the latest docker image) Requirement 2: Whenever I When a specific configMap is updated, the client cluster should all automatically start using the new configMap. How should I achieve this? Using Kubernetes Cronjobs? Kubernetes operator? or something else
- Golang . kubernetes 532 2024-02-09 22:18:19
-
- systemd: A super toolbox on Linux
- systemd is a modern initialization system on Linux. It is responsible for managing system startup, service running, user login, etc. The goal of systemd is to provide a fast, flexible, and scalable system management framework. However, systemd is not just an initialization system, it also provides many other functions and tools, allowing you to manage and monitor your Linux system more conveniently. In this article, we will introduce three amazing things you can do with systemd, they are: Simplify Linuxps: Use the systemd-cgtop command to view the system load based on control groups Linux scheduled tasks: Use systemd timers to schedule periodic execution of
- LINUX . kubernetes 1103 2024-02-09 17:42:20
-
- Kubernetes Watch returns empty results (empty type, empty object)
- I'm using Kubernetesclient-go to monitor some resources. funcwatchGVR(ctxcontext.Context,args*Arguments,dynClient*dynamic.DynamicClient,gvrschema.GroupVersionResource)error{//ifgvr.Group=="events.k8s.io"&&gvr.Resource==fmt.Printf("Watching%q% q\n",gvr
- Golang . kubernetes 778 2024-02-09 12:06:08
-
- Unable to execute shell on K8S pod
- Use rancher-2.6.6 to install k8s (v1.23.7+rke2r2). Related questions are here. I cannot execute shell on any container in k8s (v1.23.7+rke2r2). The log is a bit long, I don't know if it will be helpful. I'm new to go and it took me a few hours and I don't know how to solve it. Any help would be very happy. [root@123~]#/var/lib/rancher/rke2/bin/kubectl--kubeconfigrke2.yaml-nminio--v=9exec--stdin--ttyconsol
- Golang . kubernetes 1135 2024-02-09 12:00:12
-
- Set up Kubernetes Pods with API calls using Go and the Operator SDK
- I'm trying to create a controller that can create and delete Pods via API calls using operator-sdk and Go. The controller should be able to accept a POST call with information like {imageTag:"",namespace:""} to set up a Pod that can return the podId, and also be able to delete the Pod via an API call using the podId. I've looked at some tutorials, But it's not clear to me how Go operators intercept API calls. is it possible? Any help on this matter would be greatly appreciated. Thanks.
- Golang . kubernetes 915 2024-02-09 11:00:18
-
- Exit after the container is finished running
- My golangfiber server automatically exits with the following message when running on googlecloudrun: containercalledexit(0). I run it using the following dockerfile #usetheofficalgolangimagetocreateabinary.fromgolang:busterasbuilder#createandchangetotheappdirectory.workdir/app#retrieveap
- Golang . kubernetes 1191 2024-02-09 09:50:19
-
- How to create CDKTF script in golang to create Kubernetes namespace
- I have terraform script for creating kubernetes namespace but I can't find the import statement for the package in golang that does the same job in ckdtf for golang. resource"kubernetes_namespace""stage-namespace-1"{depends_on=[google_container_cluster.primary]metadata{annotations={name="example-annota"
- Golang . kubernetes 494 2024-02-09 09:03:22
-
- How to return default false if property does not exist in values.yaml file?
- yaml file. I have a value defined under global like this global:logging:log4j:enabled:true I also have a helper function {{-define "helm-basic-template.logging-enabled"-}}{{.Values .global.logging.log4j.enabled|default"false"}}{{-end-}}The property global.logging.log4j.enabled may not exist, in this case
- Golang . kubernetes 569 2024-02-09 08:51:11
-
- How to get 'friendly' responses from Kubernetes APIServer using ReST interface
- I am using golangclient-go library to communicate with kubernetes api server at restget, post level. The response received is not a well-formed json structure, nor is it a "kind" of API object. The program fragment is: kubeconfig:=filepath.join(os.getenv("home"),".kube","config",)config,err:=clientcmd.buildconfigfromflags("",kub
- Golang . kubernetes 1321 2024-02-09 08:10:18
-
- How to add environment variables to kubernetes deployment using golang?
- I need to set or add environment variables to an existing kubernetes deployment using golang. It should be added to the configuration after reboot. func(r*SparkETLReconciler)DoRestart(whttp.ResponseWriter,req*http.Request){ctx:=context.TODO()r.Log.Info("restarthit!")fmt.Fprintf(w,"Hithere,Ilove%s !",req.URL.Path[1:
- Golang . kubernetes 667 2024-02-08 23:45:28
-
- How to return custom user-friendly error messages in Kubernetes?
- I have a golang backend that talks to k8s. I want to rephrase the error response I get from k8s and send it to the frontend. I want to return a meaningful validation error message to the user when he adds an invalid name and something is already there...I want something generic instead of hardcoding it in the controller for each endpoint . I'm using kubernetes/client-go. First error: For example, let's say I want to add a hotel to etcd, when I try to add the hotel name: hotel123, the hotel already exists. I get this error message: \"hotel123\" already exists. What I want: hotel123
- Golang . kubernetes 997 2024-02-08 23:12:21
-
- Terratest Helm Charts fail in Go unit tests
- I'm trying to use terratest to unit test my helm charts, but I'm running into a strange error: Here is my unit test: packagegrafanaimport("fmt""testing"corev1"k8s.io/api/core/v1"" github.com/gruntwork-io/terratest/modules/helm")functestgrafanahelmcharttemplate(t*testing.t){/
- Golang . kubernetes 1044 2024-02-08 23:06:28
-
- Image from ECR to EKS not working as the resulting Pod is always 0/2
- I've tried almost everything to get things on the right path but still can't get my pod to be in a usable state. So I have a basic application written in go. I created an image of my program using dockerbuild --tagdocker-gs-ping. Then I tried running the same command inside the container dockerrun --publish8080:8080docker-gs-ping and then I wanted to save my image to amazonecr, for which I Created a repository in ecr. Now, after creating the repository, I tagged the images that exist in my local. docker
- Golang . kubernetes 1128 2024-02-08 22:39:08
-
- k8s uses OwnerRef to get all pod hierarchies in the cluster
- We want to get all the pods in the cluster, so we use something like this: pods,err:=client.CoreV1().Pods("").List(context.Background(),metav1.ListOptions{}) This code will receive all pods in the cluster. My question is: Is there a code or library that can bring all pods with owner references. That is, if the pods are owned by a deployment or statfulset etc. you will get all the hierarchies, the trick here is if I need to pass something like
- Golang . kubernetes 907 2024-02-08 21:45:34
-
- Create custom resources using the go Kubernetes client
- I want to use gokubernetes client to deploy custom resources based on deployed crd. Based on the customer's documentation, I modified the example to look like this: u:=&unstructured.unstructured{}u.object=map[string]interface{}{"metadata":map[string]interface{}{"name": task.name,},"spec":map[string]interface{}{"step
- Golang . kubernetes 732 2024-02-08 21:24:34