Skip to content

Commit

Permalink
update charts
Browse files Browse the repository at this point in the history
  • Loading branch information
lengrongfu committed May 14, 2023
1 parent fc5817b commit 1c5c6c0
Show file tree
Hide file tree
Showing 15 changed files with 78 additions and 63 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/sync-helm.yaml

This file was deleted.

13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,21 @@ Helm's [documentation](https://helm.sh/docs) to get started.

Once Helm has been set up correctly, add the repo as follows:

helm repo add runtime-copilot https://lengrongfu.github.io/runtime-copilot
helm repo add runtime-copilot https://lengrongfu.github.io/runtime-copilot

If you is first time to use this repo, you need to run command as follows:

helm repo update
helm search repo runtime-copilot

If you had already added this repo earlier, run `helm repo update` to retrieve
the latest versions of the packages. You can then run `helm search repo
runtime-copilot` to see the charts.

To install the <chart-name> chart:
To install the runtime-copilot chart:

helm install runtime-copilot runtime-copilot/runtime-copilot
helm install runtime-copilot runtime-copilot/charts --namespace runtime-copilot

To uninstall the chart:

helm delete runtime-copilot
helm delete runtime-copilot --namespace runtime-copilot
4 changes: 2 additions & 2 deletions charts/runtime-copilot/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
name: charts
name: runtime-copilot
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
Expand All @@ -21,4 +21,4 @@ version: 0.1.0
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.16.0"
appVersion: "0.0.1"
28 changes: 28 additions & 0 deletions charts/runtime-copilot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Runtime Copilot Helm Charts
The main function of the runtime copilot is to assist the operation of the container runtime component (containerd), specifically for adding or deleting non-safe registries.

## Usage

[Helm](https://helm.sh) must be installed to use the charts. Please refer to
Helm's [documentation](https://helm.sh/docs) to get started.

Once Helm has been set up correctly, add the repo as follows:

helm repo add runtime-copilot https://lengrongfu.github.io/runtime-copilot

If you is first time to use this repo, you need to run command as follows:

helm repo update
helm search repo runtime-copilot

If you had already added this repo earlier, run `helm repo update` to retrieve
the latest versions of the packages. You can then run `helm search repo
runtime-copilot` to see the charts.

To install the runtime-copilot chart:

helm install runtime-copilot runtime-copilot/charts --namespace runtime-copilot

To uninstall the chart:

helm delete runtime-copilot --namespace runtime-copilot
22 changes: 18 additions & 4 deletions charts/runtime-copilot/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,18 @@ Create chart name and version as used by the chart label.
{{/*
Common labels
*/}}
{{- define "charts.labels" -}}
{{- define "charts.labels.daemon" -}}
helm.sh/chart: {{ include "charts.chart" . }}
{{ include "charts.selectorLabels" . }}
{{ include "charts.selectorLabels.daemon" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{- define "charts.labels.controllermanagaer" -}}
helm.sh/chart: {{ include "charts.chart" . }}
{{ include "charts.selectorLabels.controllermanagaer" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
Expand All @@ -45,9 +54,14 @@ app.kubernetes.io/managed-by: {{ .Release.Service }}
{{/*
Selector labels
*/}}
{{- define "charts.selectorLabels" -}}
{{- define "charts.selectorLabels.daemon" -}}
app.kubernetes.io/name: {{ include "charts.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}-daemon
{{- end }}

{{- define "charts.selectorLabels.controllermanagaer" -}}
app.kubernetes.io/name: {{ include "charts.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}-deployment
{{- end }}

{{/*
Expand Down
10 changes: 4 additions & 6 deletions charts/runtime-copilot/templates/daemon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,23 @@ metadata:
name: {{ include "charts.fullname" . }}-daemon
namespace: {{ .Release.Namespace | default "default"}}
labels:
{{- include "charts.labels" . | nindent 4 }}
{{- include "charts.labels.daemon" . | nindent 4 }}
spec:
selector:
matchLabels:
{{- include "charts.selectorLabels" . | nindent 6 }}
app.kubernetes.io/name: runtime-daemon
{{- include "charts.selectorLabels.daemon" . | nindent 6 }}
template:
metadata:
labels:
{{- include "charts.selectorLabels" . | nindent 6 }}
app.kubernetes.io/name: runtime-daemon
{{- include "charts.selectorLabels.daemon" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "charts.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- toYaml .Values.daemonPodSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}-daemon
securityContext:
Expand Down
13 changes: 6 additions & 7 deletions charts/runtime-copilot/templates/deployment.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "charts.fullname" . }}-copilot
name: {{ include "charts.fullname" . }}-deploymment
namespace: {{ .Release.Namespace | default "default"}}
labels:
{{- include "charts.labels" . | nindent 4 }}
{{- include "charts.labels.controllermanagaer" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "charts.selectorLabels" . | nindent 6 }}
app.kubernetes.io/name: runtime-copilot
{{- include "charts.selectorLabels.controllermanagaer" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "charts.selectorLabels" . | nindent 8 }}
app.kubernetes.io/name: runtime-copilot
{{- include "charts.selectorLabels.controllermanagaer" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Expand All @@ -31,12 +29,13 @@ spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}-copilot
- name: {{ .Chart.Name }}-controller-manager
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.registry }}/{{ .Values.image.controller_repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
command:
- /copilot
- --leader-elect=true
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
app.kubernetes.io/part-of: runtime-copilot
app.kubernetes.io/managed-by: kustomize
name: controller-manager-metrics-service
namespace: system
namespace: {{ .Release.Namespace | default "default"}}
spec:
ports:
- name: https
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ roleRef:
name: leader-election-role
subjects:
- kind: ServiceAccount
name: controller-manager
namespace: system
name: {{ include "charts.serviceAccountName" . }}
namespace: {{ .Release.Namespace | default "default"}}
2 changes: 2 additions & 0 deletions charts/runtime-copilot/templates/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ metadata:
rules:
- resources:
- nodes
apiGroups:
- ""
verbs:
- get
- list
Expand Down
15 changes: 0 additions & 15 deletions charts/runtime-copilot/templates/tests/test-connection.yaml

This file was deleted.

5 changes: 5 additions & 0 deletions charts/runtime-copilot/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ podAnnotations: {}
podSecurityContext:
runAsNonRoot: true

daemonPodSecurityContext:
runAsUser: 0
runAsGroup: 0
privileged: true

securityContext:
capabilities:
drop:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ spec:
capabilities:
- pull
- push
- resolve
skip_verify: true

0 comments on commit 1c5c6c0

Please sign in to comment.