Skip to content

Commit

Permalink
kustomize deploy (#104)
Browse files Browse the repository at this point in the history
* deploy: add gin env & update image tag

Signed-off-by: warjiang <1096409085@qq.com>

* deploy: use kustomize for nodePort mode

Signed-off-by: warjiang <1096409085@qq.com>

* deploy: use kustomize for ingress mode

Signed-off-by: warjiang <1096409085@qq.com>

* chore: reformat config file

Signed-off-by: warjiang <1096409085@qq.com>

* chore: merge ingress-mode/.gitignore into outside .gitignore

Signed-off-by: warjiang <1096409085@qq.com>

* Update artifacts/dashboard/karmada-dashboard-web.yaml

Co-authored-by: Hongcai Ren <renhongcai@huawei.com>
Signed-off-by: warjiang <1096409085@qq.com>

---------

Signed-off-by: warjiang <1096409085@qq.com>
Co-authored-by: Hongcai Ren <renhongcai@huawei.com>
  • Loading branch information
warjiang and RainbowMango authored Sep 5, 2024
1 parent 7e4e448 commit 33a1275
Show file tree
Hide file tree
Showing 9 changed files with 280 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ _output
charts/*/charts
cmd/ops
.turbo
.dockerconfigjson
3 changes: 3 additions & 0 deletions artifacts/dashboard/karmada-dashboard-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ spec:
name: karmada-dashboard-api
image: karmada/karmada-dashboard-api:main
imagePullPolicy: IfNotPresent
env:
- name: GIN_MODE
value: release
livenessProbe:
failureThreshold: 8
httpGet:
Expand Down
11 changes: 11 additions & 0 deletions artifacts/dashboard/karmada-dashboard-web.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,13 @@ spec:
- --static-dir=/static
- --insecure-bind-address=0.0.0.0
- --bind-address=0.0.0.0
- --dashboard-config-path=/config/dashboard-config.yaml
name: karmada-dashboard-web
image: karmada/karmada-dashboard-web:main
imagePullPolicy: IfNotPresent
env:
- name: GIN_MODE
value: release
livenessProbe:
failureThreshold: 8
httpGet:
Expand Down Expand Up @@ -58,12 +62,19 @@ spec:
- name: kubeconfig
subPath: kubeconfig
mountPath: /etc/kubeconfig
- name: dashboard-config
subPath: prod.yaml
mountPath: /config/dashboard-config.yaml
restartPolicy: Always
terminationGracePeriodSeconds: 30
volumes:
- name: kubeconfig
secret:
secretName: kubeconfig
- name: dashboard-config
configMap:
name: karmada-dashboard-configmap

---
apiVersion: v1
kind: Service
Expand Down
8 changes: 8 additions & 0 deletions artifacts/dashboard/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- karmada-dashboard-sa.yaml
- karmada-dashboard-web.yaml
- karmada-dashboard-api.yaml
- karmada-dashboard-configmap.yaml
79 changes: 79 additions & 0 deletions artifacts/overlays/ingress-mode/dashboard-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
docker_registries: []
chart_registries: []
# path_prefix: '/karmada'
path_prefix: ''
menu_configs:
- path: /overview
enable: true
sidebar_key: OVERVIEW
- path: /multicloud-resource-manage
enable: true
sidebar_key: MULTICLOUD-RESOURCE-MANAGE
children:
- path: namespace
enable: true
sidebar_key: NAMESPACE
- path: workload
enable: true
sidebar_key: WORKLOAD
- path: service
enable: true
sidebar_key: SERVICE
- path: config
enable: true
sidebar_key: CONFIG
- path: /multicloud-policy-manage
enable: true
sidebar_key: MULTICLOUD-POLICY-MANAGE
children:
- path: propagation-policy
enable: true
sidebar_key: PROPAGATION-POLICY
- path: override-policy
enable: true
sidebar_key: OVERRIDE-POLICY
- path: /cluster-manage
enable: true
sidebar_key: CLUSTER-MANAGE
- path: /basic-config
enable: true
sidebar_key: BASIC-CONFIG
children:
- path: oem
enable: false
sidebar_key: OEM
- path: upgrade
enable: false
sidebar_key: UPGRADE
- path: karmada-config
enable: true
sidebar_key: KARMADA-CONFIG
- path: helm
enable: true
sidebar_key: HELM
- path: registry
enable: true
sidebar_key: REGISTRY
- path: /advanced-config
enable: false
sidebar_key: ADVANCED-CONFIG
children:
- path: failover
enable: true
sidebar_key: FAILOVER
- path: reschedule
enable: true
sidebar_key: RESCHEDULE
- path: permission
enable: true
sidebar_key: PERMISSION
- path: /addon
enable: false
sidebar_key: ADDON
children:
- path: buildin
enable: true
sidebar_key: BUILDIN
- path: thirdparty
enable: true
sidebar_key: THIRDPARTY
14 changes: 14 additions & 0 deletions artifacts/overlays/ingress-mode/ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-karmada-dashboard
namespace: karmada-system
spec:
rules:
- http:
paths:
- backend:
serviceName: karmada-dashboard-web
servicePort: 8000
path: /
pathType: ImplementationSpecific
59 changes: 59 additions & 0 deletions artifacts/overlays/ingress-mode/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../dashboard
- ./ingress.yaml

configMapGenerator:
- name: karmada-dashboard-configmap
namespace: karmada-system
behavior: replace
files:
- prod.yaml=dashboard-config.yaml

# If you want to create secret for private registry, uncomment it
#secretGenerator:
# - name: regcred
# namespace: karmada-system
# files:
# - .dockerconfigjson
# type: kubernetes.io/dockerconfigjson

# Uncomment the patch rules to make change to ingress
#patches:
# By default, the ingress-mode will export karmada-dashboard-web with no-domain specified and served with location '/'
# If you want to specify domain or change the location path, you can uncomment the following patch code
# - target:
# kind: Ingress
# name: ingress-karmada-dashboard
# namespace: karmada-system
# patch: |-
# # If you want to specify domain, you can uncomment the first patch rules
# - op: add
# path: /spec/rules/0/host
# value: "www.example.com"
# # If you want to change the location path from '/' to customized path, you can uncomment the following patch rules
# # Noticed: the path value should be consisted with 'path_prefix' field in the './dashboard-config.yaml'
# - op: replace
# path: /spec/rules/0/http/paths/0/path
# value: "/karmada"
# # Uncomment the next two patch rules to add imagePullSecrets to deployment
# - target:
# kind: Deployment
# name: karmada-dashboard-web
# namespace: karmada-system
# patch: |-
# - op: add
# path: /spec/template/spec/imagePullSecrets
# value: [{ name: regcred }]
# - target:
# kind: Deployment
# name: karmada-dashboard-api
# namespace: karmada-system
# patch: |-
# - op: add
# path: /spec/template/spec/imagePullSecrets
# value: [{ name: regcred }]


79 changes: 79 additions & 0 deletions artifacts/overlays/nodeport-mode/dashboard-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
docker_registries: []
chart_registries: []
# path_prefix: '/karmada'
path_prefix: ''
menu_configs:
- path: /overview
enable: true
sidebar_key: OVERVIEW
- path: /multicloud-resource-manage
enable: true
sidebar_key: MULTICLOUD-RESOURCE-MANAGE
children:
- path: namespace
enable: true
sidebar_key: NAMESPACE
- path: workload
enable: true
sidebar_key: WORKLOAD
- path: service
enable: true
sidebar_key: SERVICE
- path: config
enable: true
sidebar_key: CONFIG
- path: /multicloud-policy-manage
enable: true
sidebar_key: MULTICLOUD-POLICY-MANAGE
children:
- path: propagation-policy
enable: true
sidebar_key: PROPAGATION-POLICY
- path: override-policy
enable: true
sidebar_key: OVERRIDE-POLICY
- path: /cluster-manage
enable: true
sidebar_key: CLUSTER-MANAGE
- path: /basic-config
enable: true
sidebar_key: BASIC-CONFIG
children:
- path: oem
enable: false
sidebar_key: OEM
- path: upgrade
enable: false
sidebar_key: UPGRADE
- path: karmada-config
enable: true
sidebar_key: KARMADA-CONFIG
- path: helm
enable: true
sidebar_key: HELM
- path: registry
enable: true
sidebar_key: REGISTRY
- path: /advanced-config
enable: false
sidebar_key: ADVANCED-CONFIG
children:
- path: failover
enable: true
sidebar_key: FAILOVER
- path: reschedule
enable: true
sidebar_key: RESCHEDULE
- path: permission
enable: true
sidebar_key: PERMISSION
- path: /addon
enable: false
sidebar_key: ADDON
children:
- path: buildin
enable: true
sidebar_key: BUILDIN
- path: thirdparty
enable: true
sidebar_key: THIRDPARTY
26 changes: 26 additions & 0 deletions artifacts/overlays/nodeport-mode/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

resources:
- ../../dashboard

configMapGenerator:
- name: karmada-dashboard-configmap
namespace: karmada-system
behavior: replace
files:
- prod.yaml=dashboard-config.yaml

patches:
- target:
kind: Service
name: karmada-dashboard-web
namespace: karmada-system
version: v1
patch: |-
- op: replace
path: /spec/type
value: NodePort
- op: add
path: /spec/ports/0/nodePort
value: 32000 # you can change the nodePort value

0 comments on commit 33a1275

Please sign in to comment.