Skip to content

Commit

Permalink
wip use helm for pko
Browse files Browse the repository at this point in the history
  • Loading branch information
janboll committed Jan 9, 2025
1 parent 0996ab2 commit a956894
Show file tree
Hide file tree
Showing 13 changed files with 134 additions and 2 deletions.
20 changes: 20 additions & 0 deletions config/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,26 @@
"baseDnsZoneRG": {
"type": "string"
},
"pko": {
"type": "object",
"properties": {
"image": {
"type": "string"
},
"imageManager": {
"type": "string"
},
"imageTag": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"image",
"imageManager",
"imageTag"
]
},
"clusterService": {
"type": "object",
"properties": {
Expand Down
5 changes: 5 additions & 0 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ defaults:
consumerName: hcp-underlay-{{ .ctx.regionShort }}-mgmt-{{ .ctx.stamp }}
imageBase: quay.io/redhat-user-workloads/maestro-rhtap-tenant/maestro/maestro

pko:
image: arohcpsvcdev.azurecr.io/package-operator/package-operator-package
imageManager: arohcpsvcdev.azurecr.io/package-operator/package-operator-manager
imageTag: v1.15.0

# Cluster Service
clusterService:
acrRG: global
Expand Down
5 changes: 5 additions & 0 deletions config/public-cloud-cs-pr.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@
},
"ocpAcrName": "arohcpocpdev",
"oidcStorageAccountName": "arohcpoidccspr",
"pko": {
"image": "arohcpsvcdev.azurecr.io/package-operator/package-operator-package",
"imageManager": "arohcpsvcdev.azurecr.io/package-operator/package-operator-manager",
"imageTag": "v1.15.0"
},
"podSubnetPrefix": "10.128.64.0/18",
"region": "westus3",
"regionRG": "hcp-underlay-cspr",
Expand Down
5 changes: 5 additions & 0 deletions config/public-cloud-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@
},
"ocpAcrName": "arohcpocpdev",
"oidcStorageAccountName": "arohcpoidcdev",
"pko": {
"image": "arohcpsvcdev.azurecr.io/package-operator/package-operator-package",
"imageManager": "arohcpsvcdev.azurecr.io/package-operator/package-operator-manager",
"imageTag": "v1.15.0"
},
"podSubnetPrefix": "10.128.64.0/18",
"region": "westus3",
"regionRG": "hcp-underlay-dev",
Expand Down
5 changes: 5 additions & 0 deletions config/public-cloud-personal-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@
},
"ocpAcrName": "arohcpocpdev",
"oidcStorageAccountName": "arohcpoidcusw3tst",
"pko": {
"image": "arohcpsvcdev.azurecr.io/package-operator/package-operator-package",
"imageManager": "arohcpsvcdev.azurecr.io/package-operator/package-operator-manager",
"imageTag": "v1.15.0"
},
"podSubnetPrefix": "10.128.64.0/18",
"region": "westus3",
"regionRG": "hcp-underlay-usw3tst",
Expand Down
13 changes: 11 additions & 2 deletions pko/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
SHELL = /bin/bash
-include ../setup-env.mk
-include ../helm-cmd.mk
HELM_CMD ?= helm upgrade --install

NAMESPACE ?= package-operator-system

deploy:
kubectl apply -f https://github.com/package-operator/package-operator/releases/download/v1.15.0/self-bootstrap-job.yaml
@kubectl create namespace ${NAMESPACE} --dry-run=client -o json | kubectl apply -f -
${HELM_CMD} package-operator ./helm \
--namespace ${NAMESPACE} \
--set pkoImage=${PKO_IMAGE} \
--set pkoImageManager=${PKO_IMAGE_MANAGER} \
--set pkoImageTag=${PKO_IMAGE_TAG}

.PHONY: deploy
2 changes: 2 additions & 0 deletions pko/config.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
IMAGE_BASE ?= arohcpsvcdev.azurecr.io/package-operator/package-operator-package
IMAGE_TAG ?= v1.11.0
7 changes: 7 additions & 0 deletions pko/helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v2
name: package-operator
description: A Helm chart for package-operator
type: application

version: 0.1.0
appVersion: "1.0.0"
14 changes: 14 additions & 0 deletions pko/helm/templates/clusterrolebinding.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: package-operator
labels:
package-operator.run/cache: "True"
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: package-operator
namespace: package-operator-system
28 changes: 28 additions & 0 deletions pko/helm/templates/job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
apiVersion: batch/v1
kind: Job
metadata:
name: package-operator-bootstrap
namespace: package-operator-system
spec:
# delete right after completion
ttlSecondsAfterFinished: 0
# set deadline to 30min
activeDeadlineSeconds: 1800
template:
spec:
restartPolicy: OnFailure
serviceAccountName: package-operator
containers:
- name: package-operator
image: "{{ .Values.pkoImageManager }}:{{ .Values.pkoImageTag }}"
args: ["-self-bootstrap={{ .Values.pkoImage }}:{{ .Values.pkoImageTag }}"]
env:
- name: PKO_REGISTRY_HOST_OVERRIDES
value: ""
- name: PKO_CONFIG
value: ''
- name: PKO_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
backoffLimit: 3
7 changes: 7 additions & 0 deletions pko/helm/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: package-operator
namespace: package-operator-system
labels:
package-operator.run/cache: "True"
3 changes: 3 additions & 0 deletions pko/helm/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pkoImage: ""
pkoImageManager: ""
pkoImageTag: ""

Check failure on line 3 in pko/helm/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test

3:16 [new-line-at-end-of-file] no new line character at the end of file
22 changes: 22 additions & 0 deletions pko/pipeline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
$schema: "pipeline.schema.v1"
serviceGroup: Microsoft.Azure.ARO.HCP.RP.PKO
rolloutName: RP PKO Rollout
resourceGroups:
- name: {{ .mgmt.rg }}
subscription: {{ .svc.subscription }}
aksCluster: {{ .aksName }}
steps:
- name: deploy
action: Shell
command: make deploy
dryRun:
variables:
- name: DRY_RUN
value: "true"
variables:
- name: PKO_IMAGE
configRef: pko.image
- name: PKO_IMAGE_MANAGER
configRef: pko.imageManager
- name: PKO_IMAGE_TAG
configRef: pko.imageTag

0 comments on commit a956894

Please sign in to comment.