Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Templates for kube-proxy #4

Open
kvaps opened this issue Nov 9, 2020 · 0 comments
Open

Templates for kube-proxy #4

kvaps opened this issue Nov 9, 2020 · 0 comments

Comments

@kvaps
Copy link
Member

kvaps commented Nov 9, 2020

Kube-proxy consists of 6 manifests:

# helm install foo kvaps/kubernetes --set persistence.enabled=false --set admin.job.enabled=false
# kubectl exec -ti deploy/foo-kubernetes-admin -- sh
# kubeadm init phase addon kube-proxy -v 10 2>&1 | sed -n 's/.*Request Body: //p'
{"kind":"ServiceAccount","apiVersion":"v1","metadata":{"name":"kube-proxy","namespace":"kube-system","creationTimestamp":null}}
{"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"kube-proxy","namespace":"kube-system","creationTimestamp":null,"labels":{"app":"kube-proxy"},"annotations":{"kubeadm.kubernetes.io/component-config.hash":"sha256:e77da6dcbaed695c37e260873762a84e5c347369c68d3d2249a2cf2c439b550a"}},"data":{"config.conf":"apiVersion: kubeproxy.config.k8s.io/v1alpha1\nbindAddress: 0.0.0.0\nbindAddressHardFail: false\nclientConnection:\n  acceptContentTypes: \"\"\n  burst: 0\n  contentType: \"\"\n  kubeconfig: /var/lib/kube-proxy/kubeconfig.conf\n  qps: 0\nclusterCIDR: \"\"\nconfigSyncPeriod: 0s\nconntrack:\n  maxPerCore: null\n  min: null\n  tcpCloseWaitTimeout: null\n  tcpEstablishedTimeout: null\ndetectLocalMode: \"\"\nenableProfiling: false\nhealthzBindAddress: \"\"\nhostnameOverride: \"\"\niptables:\n  masqueradeAll: false\n  masqueradeBit: null\n  minSyncPeriod: 0s\n  syncPeriod: 0s\nipvs:\n  excludeCIDRs: null\n  minSyncPeriod: 0s\n  scheduler: \"\"\n  strictARP: false\n  syncPeriod: 0s\n  tcpFinTimeout: 0s\n  tcpTimeout: 0s\n  udpTimeout: 0s\nkind: KubeProxyConfiguration\nmetricsBindAddress: \"\"\nmode: \"\"\nnodePortAddresses: null\noomScoreAdj: null\nportRange: \"\"\nshowHiddenMetricsForVersion: \"\"\nudpIdleTimeout: 0s\nwinkernel:\n  enableDSR: false\n  networkName: \"\"\n  sourceVip: \"\"","kubeconfig.conf":"apiVersion: v1\nkind: Config\nclusters:\n- cluster:\n    certificate-authority: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt\n    server: https://10.112.2.112:6443\n  name: default\ncontexts:\n- context:\n    cluster: default\n    namespace: default\n    user: default\n  name: default\ncurrent-context: default\nusers:\n- name: default\n  user:\n    tokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token"}}
{"kind":"DaemonSet","apiVersion":"apps/v1","metadata":{"name":"kube-proxy","namespace":"kube-system","creationTimestamp":null,"labels":{"k8s-app":"kube-proxy"}},"spec":{"selector":{"matchLabels":{"k8s-app":"kube-proxy"}},"template":{"metadata":{"creationTimestamp":null,"labels":{"k8s-app":"kube-proxy"}},"spec":{"volumes":[{"name":"kube-proxy","configMap":{"name":"kube-proxy"}},{"name":"xtables-lock","hostPath":{"path":"/run/xtables.lock","type":"FileOrCreate"}},{"name":"lib-modules","hostPath":{"path":"/lib/modules"}}],"containers":[{"name":"kube-proxy","image":"k8s.gcr.io/kube-proxy:v1.19.3","command":["/usr/local/bin/kube-proxy","--config=/var/lib/kube-proxy/config.conf","--hostname-override=$(NODE_NAME)"],"env":[{"name":"NODE_NAME","valueFrom":{"fieldRef":{"fieldPath":"spec.nodeName"}}}],"resources":{},"volumeMounts":[{"name":"kube-proxy","mountPath":"/var/lib/kube-proxy"},{"name":"xtables-lock","mountPath":"/run/xtables.lock"},{"name":"lib-modules","readOnly":true,"mountPath":"/lib/modules"}],"imagePullPolicy":"IfNotPresent","securityContext":{"privileged":true}}],"nodeSelector":{"kubernetes.io/os":"linux"},"serviceAccountName":"kube-proxy","hostNetwork":true,"tolerations":[{"key":"CriticalAddonsOnly","operator":"Exists"},{"operator":"Exists"}],"priorityClassName":"system-node-critical"}},"updateStrategy":{"type":"RollingUpdate"}},"status":{"currentNumberScheduled":0,"numberMisscheduled":0,"desiredNumberScheduled":0,"numberReady":0}}
{"kind":"ClusterRoleBinding","apiVersion":"rbac.authorization.k8s.io/v1","metadata":{"name":"kubeadm:node-proxier","creationTimestamp":null},"subjects":[{"kind":"ServiceAccount","name":"kube-proxy","namespace":"kube-system"}],"roleRef":{"apiGroup":"rbac.authorization.k8s.io","kind":"ClusterRole","name":"system:node-proxier"}}
{"kind":"Role","apiVersion":"rbac.authorization.k8s.io/v1","metadata":{"name":"kube-proxy","namespace":"kube-system","creationTimestamp":null},"rules":[{"verbs":["get"],"apiGroups":[""],"resources":["configmaps"],"resourceNames":["kube-proxy"]}]}
{"kind":"RoleBinding","apiVersion":"rbac.authorization.k8s.io/v1","metadata":{"name":"kube-proxy","namespace":"kube-system","creationTimestamp":null},"subjects":[{"kind":"Group","name":"system:bootstrappers:kubeadm:default-node-token"}],"roleRef":{"apiGroup":"rbac.authorization.k8s.io","kind":"Role","name":"kube-proxy"}}

There is a need to convert them to templates, parametrize like konnectivity-agent and put into manifests directory

https://github.com/kvaps/kubernetes-in-kubernetes/blob/c181314d84f3545409cb5569599c217effbc0e6b/deploy/helm/kubernetes/values.yaml#L283-L308

Initial work started at kube-proxy-manifests branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant