Skip to content

Commit

Permalink
fix: Kubernetes dist YAML file should not container duplicate contents (
Browse files Browse the repository at this point in the history
#489)

* Specify helmfile when generating deploy YAML

* Remove duplicate from Kubernetes dist YAML
  • Loading branch information
niallthomson authored Mar 12, 2024
1 parent 85f0e81 commit b545816
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 360 deletions.
361 changes: 2 additions & 359 deletions dist/kubernetes/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,364 +19,7 @@ metadata:
name: catalog-db
data:
username: "Y2F0YWxvZw=="
password: "cUxJUEVuZmlUd3lpUjBxbQ=="
---
# Source: catalog/templates/configmap.yml
apiVersion: v1
kind: ConfigMap
metadata:
name: catalog
data:
DB_ENDPOINT: catalog-mysql:3306
DB_READ_ENDPOINT: catalog-mysql:3306
DB_NAME: catalog
---
# Source: catalog/templates/mysql-service.yaml
apiVersion: v1
kind: Service
metadata:
name: catalog-mysql
labels:
helm.sh/chart: catalog-0.0.1
app.kubernetes.io/name: catalog
app.kubernetes.io/instance: catalog
app.kubernetes.io/component: mysql
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
ports:
- port: 3306
targetPort: mysql
protocol: TCP
name: mysql
selector:
app.kubernetes.io/name: catalog
app.kubernetes.io/instance: catalog
app.kubernetes.io/component: mysql
---
# Source: catalog/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: catalog
labels:
helm.sh/chart: catalog-0.0.1
app.kubernetes.io/name: catalog
app.kubernetes.io/instance: catalog
app.kubernetes.io/component: service
app.kuberneres.io/owner: retail-store-sample
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
ports:
- port: 80
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: catalog
app.kubernetes.io/instance: catalog
app.kubernetes.io/component: service
app.kuberneres.io/owner: retail-store-sample
---
# Source: catalog/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: catalog
labels:
helm.sh/chart: catalog-0.0.1
app.kubernetes.io/name: catalog
app.kubernetes.io/instance: catalog
app.kubernetes.io/component: service
app.kuberneres.io/owner: retail-store-sample
app.kubernetes.io/managed-by: Helm
spec:
replicas: 1
strategy:
rollingUpdate:
maxUnavailable: 1
type: RollingUpdate
selector:
matchLabels:
app.kubernetes.io/name: catalog
app.kubernetes.io/instance: catalog
app.kubernetes.io/component: service
app.kuberneres.io/owner: retail-store-sample
template:
metadata:
annotations:
prometheus.io/path: /metrics
prometheus.io/port: "8080"
prometheus.io/scrape: "true"
labels:
app.kubernetes.io/name: catalog
app.kubernetes.io/instance: catalog
app.kubernetes.io/component: service
app.kuberneres.io/owner: retail-store-sample
spec:
serviceAccountName: catalog
securityContext:
fsGroup: 1000
containers:
- name: catalog
env:
- name: DB_USER
valueFrom:
secretKeyRef:
name: catalog-db
key: username
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: catalog-db
key: password
envFrom:
- configMapRef:
name: catalog
securityContext:
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
image: "public.ecr.aws/aws-containers/retail-store-sample-catalog:0.7.1"
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 8080
protocol: TCP
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 30
periodSeconds: 3
resources:
limits:
memory: 256Mi
requests:
cpu: 128m
memory: 256Mi
volumeMounts:
- mountPath: /tmp
name: tmp-volume
volumes:
- name: tmp-volume
emptyDir:
medium: Memory
---
# Source: catalog/templates/mysql-statefulset.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: catalog-mysql
labels:
helm.sh/chart: catalog-0.0.1
app.kubernetes.io/name: catalog
app.kubernetes.io/instance: catalog
app.kubernetes.io/component: mysql
app.kubernetes.io/managed-by: Helm
spec:
replicas: 1
serviceName: catalog-mysql
selector:
matchLabels:
app.kubernetes.io/name: catalog
app.kubernetes.io/instance: catalog
app.kubernetes.io/component: mysql
template:
metadata:
labels:
app.kubernetes.io/name: catalog
app.kubernetes.io/instance: catalog
app.kubernetes.io/component: mysql
spec:
containers:
- name: mysql
image: "public.ecr.aws/docker/library/mysql:5.7"
imagePullPolicy: IfNotPresent
env:
- name: MYSQL_ROOT_PASSWORD
value: my-secret-pw
- name: MYSQL_DATABASE
value: catalog
- name: MYSQL_USER
valueFrom:
secretKeyRef:
name: catalog-db
key: username
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: catalog-db
key: password
args:
- "--ignore-db-dir=lost+found"
volumeMounts:
- name: data
mountPath: /var/lib/mysql
ports:
- name: mysql
containerPort: 3306
protocol: TCP
volumes:
- name: data
emptyDir: {}

---
# Source: ui/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: ui
labels:
helm.sh/chart: ui-0.0.1
app.kubernetes.io/name: ui
app.kubernetes.io/instance: ui
app.kubernetes.io/component: service
app.kuberneres.io/owner: retail-store-sample
app.kubernetes.io/managed-by: Helm
---
# Source: ui/templates/configmap.yml
apiVersion: v1
kind: ConfigMap
metadata:
name: ui
data:

ENDPOINTS_CATALOG: http://catalog
---
# Source: ui/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: ui
labels:
helm.sh/chart: ui-0.0.1
app.kubernetes.io/name: ui
app.kubernetes.io/instance: ui
app.kubernetes.io/component: service
app.kuberneres.io/owner: retail-store-sample
app.kubernetes.io/managed-by: Helm
spec:
type: LoadBalancer
ports:
- port: 80
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: ui
app.kubernetes.io/instance: ui
app.kubernetes.io/component: service
app.kuberneres.io/owner: retail-store-sample
---
# Source: ui/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: ui
labels:
helm.sh/chart: ui-0.0.1
app.kubernetes.io/name: ui
app.kubernetes.io/instance: ui
app.kubernetes.io/component: service
app.kuberneres.io/owner: retail-store-sample
app.kubernetes.io/managed-by: Helm
spec:
replicas: 1
strategy:
rollingUpdate:
maxUnavailable: 1
type: RollingUpdate
selector:
matchLabels:
app.kubernetes.io/name: ui
app.kubernetes.io/instance: ui
app.kubernetes.io/component: service
app.kuberneres.io/owner: retail-store-sample
template:
metadata:
annotations:
prometheus.io/path: /actuator/prometheus
prometheus.io/port: "8080"
prometheus.io/scrape: "true"
labels:
app.kubernetes.io/name: ui
app.kubernetes.io/instance: ui
app.kubernetes.io/component: service
app.kuberneres.io/owner: retail-store-sample
spec:
serviceAccountName: ui
securityContext:
fsGroup: 1000
containers:
- name: ui
env:
- name: JAVA_OPTS
value: -XX:MaxRAMPercentage=75.0 -Djava.security.egd=file:/dev/urandom
envFrom:
- configMapRef:
name: ui
securityContext:
capabilities:
add:
- NET_BIND_SERVICE
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
image: "public.ecr.aws/aws-containers/retail-store-sample-ui:0.7.1"
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 8080
protocol: TCP
livenessProbe:
httpGet:
path: /actuator/health/liveness
port: 8080
initialDelaySeconds: 45
periodSeconds: 3
resources:
limits:
memory: 512Mi
requests:
cpu: 128m
memory: 512Mi
volumeMounts:
- mountPath: /tmp
name: tmp-volume
volumes:
- name: tmp-volume
emptyDir:
medium: Memory

---
# Source: catalog/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: catalog
labels:
helm.sh/chart: catalog-0.0.1
app.kubernetes.io/name: catalog
app.kubernetes.io/instance: catalog
app.kubernetes.io/component: service
app.kuberneres.io/owner: retail-store-sample
app.kubernetes.io/managed-by: Helm
---
# Source: catalog/templates/mysql-secret.yaml
apiVersion: v1
kind: Secret
metadata:
name: catalog-db
data:
username: "Y2F0YWxvZw=="
password: "SU4xaU5NdnBQV1NmSkhLcA=="
password: "aGNzNXhpcXY3M09PcEx3UQ=="
---
# Source: catalog/templates/configmap.yml
apiVersion: v1
Expand Down Expand Up @@ -793,7 +436,7 @@ metadata:
name: orders-db
data:
username: "b3JkZXJz"
password: "anRzVm1pY0RFUkJrTkxXMw=="
password: "T2NBdXcyb2dTbzYzeWUwTA=="
---
# Source: orders/templates/rabbitmq-secret.yaml
apiVersion: v1
Expand Down
2 changes: 1 addition & 1 deletion scripts/patch-image-tag.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ find deploy/kubernetes/charts '(' -name \*-baseline -o -name \*-merge -o
mkdir -p dist/kubernetes dist/docker-compose

# Template Kubernetes YAML
LOAD_BALANCER=yes helmfile -f deploy/kubernetes/charts template --skip-tests > dist/kubernetes/deploy.yaml
LOAD_BALANCER=yes helmfile -f deploy/kubernetes/charts/helmfile.yaml template --skip-tests > dist/kubernetes/deploy.yaml

# Template docker-compose
cp deploy/docker-compose/docker-compose.yml dist/docker-compose/docker-compose.yml
Expand Down

0 comments on commit b545816

Please sign in to comment.