current location:Home > Technical Articles > Operation and Maintenance

  • Building a Kubernetes Operator for rolling updates
    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: 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)
    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
    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
    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
    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
    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?
    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
    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?
    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?
    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
    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
    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
    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
    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

Tool Recommendations

jQuery enterprise message form contact code

jQuery enterprise message form contact code is a simple and practical enterprise message form and contact us introduction page code.
form button
2024-02-29

HTML5 MP3 music box playback effects

HTML5 MP3 music box playback special effect is an mp3 music player based on HTML5 css3 to create cute music box emoticons and click the switch button.

HTML5 cool particle animation navigation menu special effects

HTML5 cool particle animation navigation menu special effect is a special effect that changes color when the navigation menu is hovered by the mouse.
Menu navigation
2024-02-29

jQuery visual form drag and drop editing code

jQuery visual form drag and drop editing code is a visual form based on jQuery and bootstrap framework.
form button
2024-02-29

Organic fruit and vegetable supplier web template Bootstrap5

An organic fruit and vegetable supplier web template-Bootstrap5
Bootstrap template
2023-02-03

Bootstrap3 multifunctional data information background management responsive web page template-Novus

Bootstrap3 multifunctional data information background management responsive web page template-Novus
backend template
2023-02-02

Real estate resource service platform web page template Bootstrap5

Real estate resource service platform web page template Bootstrap5
Bootstrap template
2023-02-02

Simple resume information web template Bootstrap4

Simple resume information web template Bootstrap4
Bootstrap template
2023-02-02

Cute summer elements vector material (EPS PNG)

This is a cute summer element vector material, including the sun, sun hat, coconut tree, bikini, airplane, watermelon, ice cream, ice cream, cold drink, swimming ring, flip-flops, pineapple, conch, shell, starfish, crab, Lemons, sunscreen, sunglasses, etc., the materials are provided in EPS and PNG formats, including JPG previews.
PNG material
2024-05-09

Four red 2023 graduation badges vector material (AI EPS PNG)

This is a red 2023 graduation badge vector material, four in total, available in AI, EPS and PNG formats, including JPG preview.
PNG material
2024-02-29

Singing bird and cart filled with flowers design spring banner vector material (AI EPS)

This is a spring banner vector material designed with singing birds and a cart full of flowers. It is available in AI and EPS formats, including JPG preview.
banner picture
2024-02-29

Golden graduation cap vector material (EPS PNG)

This is a golden graduation cap vector material, available in EPS and PNG formats, including JPG preview.
PNG material
2024-02-27

Home Decor Cleaning and Repair Service Company Website Template

Home Decoration Cleaning and Maintenance Service Company Website Template is a website template download suitable for promotional websites that provide home decoration, cleaning, maintenance and other service organizations. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-05-09

Fresh color personal resume guide page template

Fresh color matching personal job application resume guide page template is a personal job search resume work display guide page web template download suitable for fresh color matching style. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-29

Designer Creative Job Resume Web Template

Designer Creative Job Resume Web Template is a downloadable web template for personal job resume display suitable for various designer positions. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28

Modern engineering construction company website template

The modern engineering and construction company website template is a downloadable website template suitable for promotion of the engineering and construction service industry. Tip: This template calls the Google font library, and the page may open slowly.
Front-end template
2024-02-28