Skip to content

Commit

Permalink
fix kustomize configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Ziming Zhang <zziming@vmware.com>
  • Loading branch information
bitsf committed Apr 15, 2021
1 parent 7f62810 commit 3d547df
Show file tree
Hide file tree
Showing 7 changed files with 216 additions and 20 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ deploy-rbac: go-generate kustomize

deployment-generate: go-generate kustomize
$(KUSTOMIZE) build manifests/cluster > manifests/cluster/deployment.yaml
$(KUSTOMIZE) build manifests/harbor > manifests/harbor/deployment.yaml

.PHONY: sample
sample: sample-harbor
Expand Down
15 changes: 15 additions & 0 deletions config/config/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- key: controllers-config-directory
priority: 100
value: /etc/harbor-operator

- key: classname
priority: 100
value:

- key: network-policies
priority: 100
value: false

- key: watch-children
priority: 100
value: true
18 changes: 18 additions & 0 deletions config/config/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,21 @@ configMapGenerator:
- assets/portal-config.conf.tmpl
- assets/registry-config.yaml.tmpl
- assets/registryctl-config.yaml.tmpl

- name: config
behavior: create
files:
- controllers/core-ctrl.yaml
- controllers/chartmuseum-ctrl.yaml
- controllers/exporter-ctrl.yaml
- controllers/harbor-ctrl.yaml
- controllers/harborcluster-ctrl.yaml
- controllers/harborconfiguration-ctrl.yaml
- controllers/jobservice-ctrl.yaml
- controllers/notaryserver-ctrl.yaml
- controllers/notarysigner-ctrl.yaml
- controllers/portal-ctrl.yaml
- controllers/registry-ctrl.yaml
- controllers/registryctl-ctrl.yaml
- controllers/trivy-ctrl.yaml
- config.yaml
2 changes: 2 additions & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: CONFIGURATION_FROM
value: env,file:/etc/harbor-operator/config.yaml

terminationGracePeriodSeconds: 10
6 changes: 6 additions & 0 deletions config/manager/patches-configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ spec:
- mountPath: /etc/harbor-operator/templates
name: configuration-templates
readOnly: true
- mountPath: /etc/harbor-operator
name: configuration
readOnly: true
volumes:
- name: configuration-templates
configMap:
name: config-template
- name: configuration
configMap:
name: config
87 changes: 87 additions & 0 deletions manifests/cluster/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20919,6 +20919,85 @@ subjects:
namespace: harbor-operator-ns
---
apiVersion: v1
data:
chartmuseum-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
config.yaml: |
- key: controllers-config-directory
priority: 100
value: /etc/harbor-operator

- key: classname
priority: 100
value:

- key: network-policies
priority: 100
value: false

- key: watch-children
priority: 100
value: true
core-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
exporter-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
harbor-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
harborcluster-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
harborconfiguration-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
jobservice-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
notaryserver-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
notarysigner-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
portal-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
registry-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
registryctl-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
trivy-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
kind: ConfigMap
metadata:
annotations:
goharbor.io/deploy-engine: Kustomization
goharbor.io/deploy-mode: cluster
goharbor.io/operator-version: v1.0.0
name: config
namespace: harbor-operator-ns
---
apiVersion: v1
data:
chartmuseum-config.yaml.tmpl: |
{{- if .Spec.Server.TLS.Enabled }}
Expand Down Expand Up @@ -21462,6 +21541,8 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: CONFIGURATION_FROM
value: env,file:/etc/harbor-operator/config.yaml
image: goharbor/harbor-operator:dev_master
livenessProbe:
httpGet:
Expand Down Expand Up @@ -21498,6 +21579,9 @@ spec:
- mountPath: /etc/harbor-operator/templates
name: configuration-templates
readOnly: true
- mountPath: /etc/harbor-operator
name: configuration
readOnly: true
securityContext:
runAsUser: 65532
terminationGracePeriodSeconds: 10
Expand All @@ -21509,6 +21593,9 @@ spec:
- configMap:
name: config-template
name: configuration-templates
- configMap:
name: config
name: configuration
---
apiVersion: apps/v1
kind: Deployment
Expand Down
107 changes: 87 additions & 20 deletions manifests/harbor/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2222,26 +2222,6 @@ spec:
jsonPath: .status.status
name: Status
type: string
- description: The current status of the new Harbor spec
jsonPath: .status.conditions[?(@.type=="ServiceReady")].status
name: Service Ready
priority: 10
type: string
- description: The current status of the new Cache spec
jsonPath: .status.conditions[?(@.type=="CacheReady")].status
name: Cache Ready
priority: 20
type: string
- description: The current status of the new Database spec
jsonPath: .status.conditions[?(@.type=="DatabaseReady")].status
name: Database Ready
priority: 20
type: string
- description: The current status of the new Storage spec
jsonPath: .status.conditions[?(@.type=="StorageReady")].status
name: Storage Ready
priority: 20
type: string
- description: 'The operator version '
jsonPath: .status.operator.controllerVersion
name: Operator Version
Expand Down Expand Up @@ -13342,6 +13322,85 @@ subjects:
namespace: harbor-operator-ns
---
apiVersion: v1
data:
chartmuseum-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
config.yaml: |
- key: controllers-config-directory
priority: 100
value: /etc/harbor-operator

- key: classname
priority: 100
value:

- key: network-policies
priority: 100
value: false

- key: watch-children
priority: 100
value: true
core-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
exporter-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
harbor-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
harborcluster-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
harborconfiguration-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
jobservice-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
notaryserver-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
notarysigner-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
portal-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
registry-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
registryctl-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
trivy-ctrl.yaml: |
- key: max-reconcile
priority: 200
value: "1"
kind: ConfigMap
metadata:
annotations:
goharbor.io/deploy-engine: Kustomization
goharbor.io/deploy-mode: harbor
goharbor.io/operator-version: v1.0.0
name: config
namespace: harbor-operator-ns
---
apiVersion: v1
data:
chartmuseum-config.yaml.tmpl: |
{{- if .Spec.Server.TLS.Enabled }}
Expand Down Expand Up @@ -13709,6 +13768,8 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
- name: CONFIGURATION_FROM
value: env,file:/etc/harbor-operator/config.yaml
image: goharbor/harbor-operator:latest
livenessProbe:
httpGet:
Expand Down Expand Up @@ -13745,6 +13806,9 @@ spec:
- mountPath: /etc/harbor-operator/templates
name: configuration-templates
readOnly: true
- mountPath: /etc/harbor-operator
name: configuration
readOnly: true
securityContext:
runAsUser: 65532
terminationGracePeriodSeconds: 10
Expand All @@ -13756,6 +13820,9 @@ spec:
- configMap:
name: config-template
name: configuration-templates
- configMap:
name: config
name: configuration
---
apiVersion: cert-manager.io/v1
kind: Certificate
Expand Down

0 comments on commit 3d547df

Please sign in to comment.