Skip to content

Commit

Permalink
commit generated charts (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppalucki authored May 10, 2024
1 parent 83c4e0d commit 5d21b08
Show file tree
Hide file tree
Showing 22 changed files with 959 additions and 6 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ cri-resource-manager-0.6.0.x86_64.tar.gz
/gardener-extension-cri-resmgr.actuator.test
/gardener-extension-cri-resmgr.configs.test
/cmd/gardener-extension-cri-resmgr/__debug_bin
/pkg/consts/charts
coverage.*
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,20 @@ clean-images:
docker image rm $(REGISTRY)$(EXTENSION_IMAGE_NAME):$(TAG)
docker image rm $(REGISTRY)$(INSTALLATION_IMAGE_NAME):$(TAG)

_build-extension-image:
@echo "Building extension image: commit=${COMMIT}${DIRTY} version=${VERSION} target=$(REGISTRY)$(EXTENSION_IMAGE_NAME):$(TAG)"
regenerate-charts:
rm -rf ./pkg/consts/charts
go generate ./...

_build-extension-image:
@echo "Building extension image: commit=${COMMIT}${DIRTY} version=${VERSION} target=$(REGISTRY)$(EXTENSION_IMAGE_NAME):$(TAG)"
docker build --build-arg COMMIT=${COMMIT}${DIRTY} --build-arg VERSION=${VERSION} -t $(REGISTRY)$(EXTENSION_IMAGE_NAME):$(TAG) -f Dockerfile --target $(EXTENSION_IMAGE_NAME) .
_build-installation-image:
@echo "Building installation image: commit=${COMMIT}${DIRTY} version=${VERSION} target=$(REGISTRY)$(INSTALLATION_IMAGE_NAME):$(TAG)"
rm -rf ./pkg/consts/charts
go generate ./...
docker build --build-arg COMMIT=${COMMIT}${DIRTY} --build-arg VERSION=${VERSION} -t $(REGISTRY)$(INSTALLATION_IMAGE_NAME):$(TAG) -f Dockerfile --target $(INSTALLATION_IMAGE_NAME) .

dist: build build-images

build-images: _build-extension-image _build-installation-image
build-images: regenerate-charts _build-extension-image _build-installation-image
echo "Building ${VERSION}-${COMMIT}${DIRTY} done."


Expand Down
21 changes: 21 additions & 0 deletions pkg/consts/charts/gardener-extension-cri-resmgr/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2022 Intel Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: v1
name: cri-resmgr-extension
description: A Helm chart to install cri-resources-manager as extension to Gardener project

type: application
version: 0.1.0
appVersion: "1.16.0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#
# Copyright 2022 Intel Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
{{- define "image" -}}
{{- if hasPrefix "sha256:" .Values.image.tag }}
{{- printf "%s@%s" .Values.image.repository .Values.image.tag }}
{{- else }}
{{- printf "%s:%s" .Values.image.repository .Values.image.tag }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# Copyright 2022 Intel Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
{{- if .Values.configs }}
apiVersion: v1
kind: ConfigMap
metadata:
name: gardener-extension-cri-resmgr-configs
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: gardener-extension-cri-resmgr
data:
{{- .Values.configs | toYaml | nindent 2 }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#
# Copyright 2022 Intel Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
{{- if .Values.imageVectorOverwrite }}
apiVersion: v1
kind: ConfigMap
metadata:
name: gardener-extension-cri-resmgr-imagevector-overwrite
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: gardener-extension-cri-resmgr
data:
images_overwrite.yaml: |
{{ .Values.imageVectorOverwrite | indent 4 }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Copyright 2022 Intel Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: apps/v1
kind: Deployment
metadata:
name: gardener-extension-cri-resmgr
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: gardener-extension-cri-resmgr
spec:
revisionHistoryLimit: 0
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app.kubernetes.io/name: gardener-extension-cri-resmgr
template:
metadata:
annotations:
{{- if .Values.imageVectorOverwrite }}
checksum/gardener-extension-cri-resmgr-imagevector-overwrite: {{ include (print $.Template.BasePath "/configmap-imagevector-overwrite.yaml") . | sha256sum }}
{{- end }}
labels:
networking.gardener.cloud/to-runtime-apiserver: allowed
app.kubernetes.io/name: gardener-extension-cri-resmgr
spec:
priorityClassName: gardener-extension-cri-resmgr
serviceAccountName: gardener-extension-cri-resmgr
containers:
- name: gardener-extension-cri-resmgr
image: {{ include "image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- /gardener-extension-cri-resmgr
env:
- name: EXTENSION_CONFIGMAP_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: LEADER_ELECTION_NAMESPACE
value: garden
{{- if .Values.imageVectorOverwrite }}
- name: IMAGEVECTOR_OVERWRITE
value: /charts_overwrite/images_overwrite.yaml
volumeMounts:
- name: imagevector-overwrite
mountPath: /charts_overwrite/
readOnly: true
volumes:
- name: imagevector-overwrite
configMap:
name: gardener-extension-cri-resmgr-imagevector-overwrite
defaultMode: 420
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2022 Intel Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: gardener-extension-cri-resmgr
value: 1000000000
globalDefault: false
description: "Priority class for the Gardener extension: cri-resmgr."
142 changes: 142 additions & 0 deletions pkg/consts/charts/gardener-extension-cri-resmgr/templates/rbac.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# Copyright 2022 Intel Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: extensions.gardener.cloud:gardener-extension-cri-resmgr
labels:
app.kubernetes.io/name: gardener-extension-cri-resmgr
app.kubernetes.io/instance: {{ .Release.Name }}
rules:
- apiGroups:
- apps
resources:
- deployments
resourceNames:
- kube-apiserver
verbs:
- get
- list
- watch
- patch
- apiGroups:
- apps
resources:
- deployments
verbs:
- get
- list
- watch
- apiGroups:
- extensions.gardener.cloud
resources:
- clusters
verbs:
- get
- list
- watch
- apiGroups:
- extensions.gardener.cloud
resources:
- dnsrecords
verbs:
- get
- list
- watch
- apiGroups:
- resources.gardener.cloud
resources:
- managedresources
verbs:
- "*"
- apiGroups:
- ""
resources:
- namespaces
verbs:
- get
- list
- watch
- apiGroups:
- extensions.gardener.cloud
resources:
- extensions
- extensions/status
verbs:
- get
- list
- watch
- patch
- update
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- create
- list
- watch
- apiGroups:
- coordination.k8s.io
resources:
- leases
resourceNames:
- gardener-extension-heartbeat
verbs:
- get
- update
- patch
- apiGroups:
- ""
resources:
- configmaps
- secrets
- events
verbs:
- "*"
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- create
- list
- watch
- apiGroups:
- coordination.k8s.io
resources:
- leases
resourceNames:
- cri-resmgr-leader-election
verbs:
- update
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: extensions.gardener.cloud:gardener-extension-cri-resmgr
labels:
app.kubernetes.io/name: gardener-extension-cri-resmgr
app.kubernetes.io/instance: {{ .Release.Name }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: extensions.gardener.cloud:gardener-extension-cri-resmgr
subjects:
- kind: ServiceAccount
name: gardener-extension-cri-resmgr
namespace: {{ .Release.Namespace }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2022 Intel Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: v1
kind: ServiceAccount
metadata:
name: gardener-extension-cri-resmgr
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: gardener-extension-cri-resmgr
Loading

0 comments on commit 5d21b08

Please sign in to comment.