Skip to content

Commit c13499a

Browse files
committed
Upgraded tenant namespace operator to osdk v1.4.0
Migrated to new directory structure Upgraded crds to apiextensions v1 Added probes to chart Updated entrypoint for new docker image Fixed references to meta in ansible role Bump tenant-namespace-operator version
1 parent 959918b commit c13499a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+754
-60
lines changed

charts/charts/tenant-namespace-operator/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ type: application
1414

1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
17-
version: 0.1.16
17+
version: 0.1.17
1818

1919
# This is the version number of the application being deployed. This version number should be
2020
# incremented each time you make changes to the application.
21-
appVersion: 0.1.13-1
21+
appVersion: 0.1.14-1

charts/charts/tenant-namespace-operator/templates/deployment.yaml

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,24 @@ spec:
3232
{{- toYaml .Values.securityContext | nindent 12 }}
3333
resources:
3434
{{- toYaml .Values.resources | nindent 12 }}
35+
livenessProbe:
36+
httpGet:
37+
path: /healthz
38+
port: 6789
39+
initialDelaySeconds: 15
40+
periodSeconds: 20
41+
readinessProbe:
42+
httpGet:
43+
path: /readyz
44+
port: 6789
45+
initialDelaySeconds: 5
46+
periodSeconds: 10
47+
args:
48+
- "--enable-leader-election"
49+
- "--leader-election-id=tenant-namespace-operator"
3550
env:
51+
- name: ANSIBLE_GATHERING
52+
value: explicit
3653
- name: WATCH_NAMESPACE
3754
{{- if eq .Values.mode "cluster" }}
3855
value: ""
@@ -41,14 +58,6 @@ spec:
4158
fieldRef:
4259
fieldPath: metadata.namespace
4360
{{- end }}
44-
- name: POD_NAME
45-
valueFrom:
46-
fieldRef:
47-
fieldPath: metadata.name
48-
- name: OPERATOR_NAME
49-
value: "tenant-namespace-operator"
50-
- name: ANSIBLE_GATHERING
51-
value: explicit
5261
- name: SERVICE_ACCOUNT_NAME
5362
value: {{ include "tenant-namespace-operator.serviceAccountName" . }}
5463
- name: NAMESPACE
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
2+
# Binaries for programs and plugins
3+
*.exe
4+
*.exe~
5+
*.dll
6+
*.so
7+
*.dylib
8+
bin
9+
10+
# editor and IDE paraphernalia
11+
.idea
12+
*.swp
13+
*.swo
14+
*~
15+
16+
bundle/
17+
bundle.Dockerfile

containers/tenant-namespace-operator/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
FROM quay.io/operator-framework/ansible-operator:v0.17.0
1+
FROM quay.io/operator-framework/ansible-operator:v1.4.0
22

3-
ARG helm_version=v3.3.4
3+
ARG helm_version=v3.5.2
44
USER 0
55
RUN \
66
yum clean all && \
@@ -32,4 +32,4 @@ RUN \
3232
echo 0.1.13 >> /.extrafingerprints && \
3333
md5sum watches.yaml >> /.extrafingerprints
3434

35-
ENTRYPOINT ["/usr/local/bin/entrypoint", "--inject-owner-ref=false"]
35+
ENTRYPOINT ["/usr/local/bin/ansible-operator", "run", "--watches-file=./watches.yaml", "--inject-owner-ref=false"]
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# VERSION defines the project version for the bundle.
2+
# Update this value when you upgrade the version of your project.
3+
# To re-generate a bundle for another specific version without changing the standard setup, you can:
4+
# - use the VERSION as arg of the bundle target (e.g make bundle VERSION=0.0.2)
5+
# - use environment variables to overwrite this value (e.g export VERSION=0.0.2)
6+
VERSION ?= 0.0.1
7+
8+
# CHANNELS define the bundle channels used in the bundle.
9+
# Add a new line here if you would like to change its default config. (E.g CHANNELS = "preview,fast,stable")
10+
# To re-generate a bundle for other specific channels without changing the standard setup, you can:
11+
# - use the CHANNELS as arg of the bundle target (e.g make bundle CHANNELS=preview,fast,stable)
12+
# - use environment variables to overwrite this value (e.g export CHANNELS="preview,fast,stable")
13+
ifneq ($(origin CHANNELS), undefined)
14+
BUNDLE_CHANNELS := --channels=$(CHANNELS)
15+
endif
16+
17+
# DEFAULT_CHANNEL defines the default channel used in the bundle.
18+
# Add a new line here if you would like to change its default config. (E.g DEFAULT_CHANNEL = "stable")
19+
# To re-generate a bundle for any other default channel without changing the default setup, you can:
20+
# - use the DEFAULT_CHANNEL as arg of the bundle target (e.g make bundle DEFAULT_CHANNEL=stable)
21+
# - use environment variables to overwrite this value (e.g export DEFAULT_CHANNEL="stable")
22+
ifneq ($(origin DEFAULT_CHANNEL), undefined)
23+
BUNDLE_DEFAULT_CHANNEL := --default-channel=$(DEFAULT_CHANNEL)
24+
endif
25+
BUNDLE_METADATA_OPTS ?= $(BUNDLE_CHANNELS) $(BUNDLE_DEFAULT_CHANNEL)
26+
27+
# BUNDLE_IMG defines the image:tag used for the bundle.
28+
# You can use it as an arg. (E.g make bundle-build BUNDLE_IMG=<some-registry>/<project-name-bundle>:<tag>)
29+
BUNDLE_IMG ?= controller-bundle:$(VERSION)
30+
31+
# Image URL to use all building/pushing image targets
32+
IMG ?= controller:latest
33+
34+
all: docker-build
35+
36+
# Run against the configured Kubernetes cluster in ~/.kube/config
37+
run: ansible-operator
38+
$(ANSIBLE_OPERATOR) run
39+
40+
# Install CRDs into a cluster
41+
install: kustomize
42+
$(KUSTOMIZE) build config/crd | kubectl apply -f -
43+
44+
# Uninstall CRDs from a cluster
45+
uninstall: kustomize
46+
$(KUSTOMIZE) build config/crd | kubectl delete -f -
47+
48+
# Deploy controller in the configured Kubernetes cluster in ~/.kube/config
49+
deploy: kustomize
50+
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
51+
$(KUSTOMIZE) build config/default | kubectl apply -f -
52+
53+
# Undeploy controller in the configured Kubernetes cluster in ~/.kube/config
54+
undeploy: kustomize
55+
$(KUSTOMIZE) build config/default | kubectl delete -f -
56+
57+
# Build the docker image
58+
docker-build:
59+
docker build -t ${IMG} .
60+
61+
# Push the docker image
62+
docker-push:
63+
docker push ${IMG}
64+
65+
PATH := $(PATH):$(PWD)/bin
66+
SHELL := env 'PATH=$(PATH)' /bin/sh
67+
OS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
68+
ARCH := $(shell uname -m | sed 's/x86_64/amd64/')
69+
70+
# Download kustomize locally if necessary, preferring the $(pwd)/bin path over global if both exist.
71+
.PHONY: kustomize
72+
KUSTOMIZE = $(shell pwd)/bin/kustomize
73+
kustomize:
74+
ifeq (,$(wildcard $(KUSTOMIZE)))
75+
ifeq (,$(shell which kustomize 2>/dev/null))
76+
@{ \
77+
set -e ;\
78+
mkdir -p $(dir $(KUSTOMIZE)) ;\
79+
curl -sSLo - https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v3.5.4/kustomize_v3.5.4_$(OS)_$(ARCH).tar.gz | \
80+
tar xzf - -C bin/ ;\
81+
}
82+
else
83+
KUSTOMIZE = $(shell which kustomize)
84+
endif
85+
endif
86+
87+
# Download ansible-operator locally if necessary, preferring the $(pwd)/bin path over global if both exist.
88+
.PHONY: ansible-operator
89+
ANSIBLE_OPERATOR = $(shell pwd)/bin/ansible-operator
90+
ansible-operator:
91+
ifeq (,$(wildcard $(ANSIBLE_OPERATOR)))
92+
ifeq (,$(shell which ansible-operator 2>/dev/null))
93+
@{ \
94+
set -e ;\
95+
mkdir -p $(dir $(ANSIBLE_OPERATOR)) ;\
96+
curl -sSLo $(ANSIBLE_OPERATOR) https://github.com/operator-framework/operator-sdk/releases/download/v1.4.0/ansible-operator_$(OS)_$(ARCH) ;\
97+
chmod +x $(ANSIBLE_OPERATOR) ;\
98+
}
99+
else
100+
ANSIBLE_OPERATOR = $(shell which ansible-operator)
101+
endif
102+
endif
103+
104+
# Generate bundle manifests and metadata, then validate generated files.
105+
.PHONY: bundle
106+
bundle: kustomize
107+
operator-sdk generate kustomize manifests -q
108+
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
109+
$(KUSTOMIZE) build config/manifests | operator-sdk generate bundle -q --overwrite --version $(VERSION) $(BUNDLE_METADATA_OPTS)
110+
operator-sdk bundle validate ./bundle
111+
112+
# Build the bundle image.
113+
.PHONY: bundle-build
114+
bundle-build:
115+
docker build -f bundle.Dockerfile -t $(BUNDLE_IMG) .
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
domain: pnnl.gov
2+
layout: ansible.sdk.operatorframework.io/v1
3+
projectName: tenant-namespace-operator
4+
resources:
5+
- group: miscscripts
6+
kind: TenantNamespace
7+
version: v1beta1
8+
- group: miscscripts
9+
kind: TenantNamespaceFlavor
10+
version: v1beta1
11+
version: 3-alpha
12+
plugins:
13+
manifests.sdk.operatorframework.io/v2: {}
14+
scorecard.sdk.operatorframework.io/v2: {}

containers/tenant-namespace-operator/build/Dockerfile

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export PREFIX=0.1.13
1+
export PREFIX=0.1.14

0 commit comments

Comments
 (0)