-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[WIP] salt, build: automate operator-controller install
- Loading branch information
Showing
9 changed files
with
1,092 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
salt/metalk8s/addons/olm/operator-controller/deployed/cert.sls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!jinja | metalk8s_kubernetes | ||
|
||
--- | ||
apiVersion: cert-manager.io/v1 | ||
kind: Certificate | ||
metadata: | ||
name: olmv1-ca | ||
namespace: metalk8s-certs | ||
spec: | ||
commonName: olmv1-ca | ||
isCA: true | ||
issuerRef: | ||
group: cert-manager.io | ||
kind: Issuer | ||
name: self-sign-issuer | ||
privateKey: | ||
algorithm: ECDSA | ||
size: 256 | ||
secretName: olmv1-ca | ||
--- | ||
apiVersion: cert-manager.io/v1 | ||
kind: Certificate | ||
metadata: | ||
name: olmv1-cert | ||
namespace: olmv1-system | ||
spec: | ||
dnsNames: | ||
- operator-controller.olmv1-system.svc | ||
- operator-controller.olmv1-system.svc.cluster.local | ||
issuerRef: | ||
group: cert-manager.io | ||
kind: ClusterIssuer | ||
name: olmv1-ca | ||
privateKey: | ||
algorithm: ECDSA | ||
size: 256 | ||
secretName: olmv1-cert | ||
--- | ||
apiVersion: cert-manager.io/v1 | ||
kind: ClusterIssuer | ||
metadata: | ||
name: olmv1-ca | ||
spec: | ||
ca: | ||
secretName: olmv1-ca | ||
--- | ||
apiVersion: cert-manager.io/v1 | ||
kind: Issuer | ||
metadata: | ||
name: self-sign-issuer | ||
namespace: metalk8s-certs | ||
spec: | ||
selfSigned: {} |
591 changes: 591 additions & 0 deletions
591
salt/metalk8s/addons/olm/operator-controller/deployed/crds.sls
Large diffs are not rendered by default.
Oops, something went wrong.
22 changes: 22 additions & 0 deletions
22
salt/metalk8s/addons/olm/operator-controller/deployed/init.sls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
include: | ||
- ...catalogd.deployed | ||
- crds | ||
- rbac | ||
- cert | ||
- operator-controller | ||
|
||
Wait for the Operator Controller Controller Manager Deployment to be Ready: | ||
test.configurable_test_state: | ||
- changes: False | ||
- result: __slot__:salt:metalk8s_kubernetes.check_object_ready( | ||
apiVersion=apps/v1, kind=Deployment, | ||
name=operator-controller-controller-manager, namespace=olmv1-system) | ||
- comment: Wait for the Operator Controller to be Ready | ||
- retry: | ||
attempts: 30 | ||
- require: | ||
- test: Wait for the Catalogd Controller Manager deployment to be Ready | ||
- sls: metalk8s.addons.olm.operator-controller.deployed.crds | ||
- sls: metalk8s.addons.olm.operator-controller.deployed.rbac | ||
- sls: metalk8s.addons.olm.operator-controller.deployed.cert | ||
- sls: metalk8s.addons.olm.operator-controller.deployed.operator-controller |
143 changes: 143 additions & 0 deletions
143
salt/metalk8s/addons/olm/operator-controller/deployed/operator-controller.sls
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
#!jinja | metalk8s_kubernetes | ||
{%- from "metalk8s/repo/macro.sls" import build_image_name with context %} | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
control-plane: operator-controller-controller-manager | ||
name: operator-controller-controller-manager-metrics-service | ||
namespace: olmv1-system | ||
spec: | ||
ports: | ||
- name: https | ||
port: 8443 | ||
protocol: TCP | ||
targetPort: https | ||
selector: | ||
control-plane: operator-controller-controller-manager | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
annotations: | ||
kubectl.kubernetes.io/default-logs-container: manager | ||
labels: | ||
control-plane: operator-controller-controller-manager | ||
name: operator-controller-controller-manager | ||
namespace: olmv1-system | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
control-plane: operator-controller-controller-manager | ||
template: | ||
metadata: | ||
annotations: | ||
kubectl.kubernetes.io/default-container: manager | ||
labels: | ||
control-plane: operator-controller-controller-manager | ||
spec: | ||
nodeSelector: | ||
kubernetes.io/os: linux | ||
node-role.kubernetes.io/infra: "" | ||
tolerations: | ||
- effect: NoSchedule | ||
key: node-role.kubernetes.io/bootstrap | ||
operator: Exists | ||
- effect: NoSchedule | ||
key: node-role.kubernetes.io/infra | ||
operator: Exists | ||
affinity: | ||
nodeAffinity: | ||
requiredDuringSchedulingIgnoredDuringExecution: | ||
nodeSelectorTerms: | ||
- matchExpressions: | ||
- key: kubernetes.io/arch | ||
operator: In | ||
values: | ||
- amd64 | ||
- arm64 | ||
- ppc64le | ||
- s390x | ||
- key: kubernetes.io/os | ||
operator: In | ||
values: | ||
- linux | ||
containers: | ||
- args: | ||
- --health-probe-bind-address=:8081 | ||
- --metrics-bind-address=127.0.0.1:8080 | ||
- --leader-elect | ||
- --ca-certs-dir=/var/certs | ||
command: | ||
- /manager | ||
image: {{ build_image_name("operator-controller") }} | ||
imagePullPolicy: IfNotPresent | ||
livenessProbe: | ||
httpGet: | ||
path: /healthz | ||
port: 8081 | ||
initialDelaySeconds: 15 | ||
periodSeconds: 20 | ||
name: manager | ||
readinessProbe: | ||
httpGet: | ||
path: /readyz | ||
port: 8081 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 10 | ||
resources: | ||
requests: | ||
cpu: 10m | ||
memory: 64Mi | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: | ||
- ALL | ||
terminationMessagePolicy: FallbackToLogsOnError | ||
volumeMounts: | ||
- mountPath: /var/cache | ||
name: cache | ||
- mountPath: /var/certs/ | ||
name: olmv1-certificate | ||
readOnly: true | ||
- args: | ||
- --secure-listen-address=0.0.0.0:8443 | ||
- --http2-disable | ||
- --upstream=http://127.0.0.1:8080/ | ||
- --logtostderr=true | ||
image: {{ build_image_name("kube-rbac-proxy") }} | ||
name: kube-rbac-proxy | ||
ports: | ||
- containerPort: 8443 | ||
name: https | ||
protocol: TCP | ||
resources: | ||
requests: | ||
cpu: 5m | ||
memory: 64Mi | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
capabilities: | ||
drop: | ||
- ALL | ||
terminationMessagePolicy: FallbackToLogsOnError | ||
securityContext: | ||
runAsNonRoot: true | ||
seccompProfile: | ||
type: RuntimeDefault | ||
serviceAccountName: operator-controller-controller-manager | ||
terminationGracePeriodSeconds: 10 | ||
volumes: | ||
- emptyDir: {} | ||
name: cache | ||
- name: olmv1-certificate | ||
secret: | ||
items: | ||
- key: ca.crt | ||
path: olm-ca.crt | ||
optional: false | ||
secretName: olmv1-cert |
Oops, something went wrong.