Skip to content

Commit 2040d0d

Browse files
committed
update ghost pacakge
1 parent 136f777 commit 2040d0d

21 files changed

+56
-142
lines changed

package-examples/ghost/README.md

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,32 @@
1+
### Ghost Application
2+
3+
"Ghost is a powerful app for new-media creators to publish, share, and grow a business around their content. It comes with modern tools to build a website, publish content, send newsletters & offer paid subscriptions to members."
4+
https://ghost.org/
5+
6+
### Quick start
7+
8+
#### Get KPT Pacakge
19
```bash
2-
# Fetch ghost helm charts
3-
helm fetch --untar bitnami/ghost
4-
# By default networking, metrics are disabled.
5-
helm template example ghost > rendered.yaml
6-
rm -rf ghost
7-
# Restructure the KRM resources by app. This should give two directories: ./mariadb /ghost
8-
kubectl-slice -f rendered.yaml --template '{{ index "app.kubernetes.io/name" .metadata.labels }}/{{.kind | lower}}-{{.metadata.name|dottodash}}.yaml' -o ghost
9-
rm rendered.yaml
10+
export NAMESPACE=<YOUR NAMESPACE>
11+
# make sure the namespace is correct and exists. Otherwise, create the namespace
12+
kubectl create namespace ${NAMESPACE}
13+
14+
# You get this Ghost package by running
15+
kpt pkg get https://github.com/GoogleContainerTools/kpt.git/package-examples/ghost@main ${NAMESPACE} --for-deployment
16+
```
17+
18+
#### Update the KRM resources to your own data
19+
20+
Updating the KRM resources are easy with variant constructor
21+
```bash
22+
kpt fn render ${NAMESPACE}
23+
```
24+
25+
#### Deploy the KRM resources to your cluster
26+
27+
```bash
28+
# Initialize inventory info. You only need to run this if do not have resourcesgroup.yaml
29+
kpt live init ${NAMESPACE}
30+
31+
kpt live apply ${NAMESPACE}
1032
```

package-examples/ghost/ghost/Kptfile renamed to package-examples/ghost/ghost-app/Kptfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
apiVersion: kpt.dev/v1
22
kind: Kptfile
33
metadata:
4-
name: ghost
4+
name: ghost-app
55
annotations:
66
config.kubernetes.io/local-config: "true"
77
info:
8-
description: sample description
8+
description: The Ghost App package contains the KRM resources for a Ghost Application.
99
pipeline:
1010
mutators:
1111
- image: gcr.io/kpt-fn/set-labels:v0.1.5

package-examples/ghost/ghost/deployment-example-ghost.yaml renamed to package-examples/ghost/ghost-app/deployment-ghost.yaml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
apiVersion: apps/v1
22
kind: Deployment
33
metadata:
4-
name: example-ghost
4+
name: ghost-app
55
namespace: example
66
spec:
77
replicas: 1
88
strategy:
99
type: RollingUpdate
1010
template:
11-
metadata:
12-
annotations:
13-
checksum/secrets: 711677f8a87ff3df1d09863858613b5dbecb3f6b8ea51a8c37b40762aff66a20
1411
spec:
1512
affinity:
1613
podAffinity:
@@ -25,7 +22,7 @@ spec:
2522
securityContext:
2623
fsGroup: 1001
2724
containers:
28-
- name: example-ghost
25+
- name: ghost-app
2926
image: docker.io/bitnami/ghost:4.45.0-debian-10-r0
3027
imagePullPolicy: "IfNotPresent"
3128
securityContext:
@@ -44,22 +41,12 @@ spec:
4441
value: "bitnami_ghost"
4542
- name: GHOST_DATABASE_USER
4643
value: "bn_ghost"
47-
- name: GHOST_DATABASE_PASSWORD
48-
valueFrom:
49-
secretKeyRef:
50-
name: example-mariadb
51-
key: mariadb-password
5244
- name: GHOST_HOST
5345
value: "aa/"
5446
- name: GHOST_PORT_NUMBER
5547
value: "2368"
5648
- name: GHOST_USERNAME
5749
value: "user"
58-
- name: GHOST_PASSWORD
59-
valueFrom:
60-
secretKeyRef:
61-
name: example-ghost
62-
key: ghost-password
6350
- name: GHOST_EMAIL
6451
value: "user@example.com"
6552
- name: GHOST_BLOG_TITLE
@@ -105,4 +92,4 @@ spec:
10592
volumes:
10693
- name: ghost-data
10794
persistentVolumeClaim:
108-
claimName: example-ghost
95+
claimName: ghost-app

package-examples/ghost/ghost/ingress-example-ghost.yaml renamed to package-examples/ghost/ghost-app/ingress-ghost.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: networking.k8s.io/v1
22
kind: Ingress
33
metadata:
4-
name: example-ghost
4+
name: ghost-app
55
namespace: example
66
spec:
77
rules:
@@ -12,6 +12,6 @@ spec:
1212
pathType: ImplementationSpecific
1313
backend:
1414
service:
15-
name: example-ghost
15+
name: ghost-app
1616
port:
1717
name: http
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: networking.k8s.io/v1
22
kind: NetworkPolicy
33
metadata:
4-
name: example-ghost-ingress
4+
name: ghost-app
55
spec:
66
ingress:

package-examples/ghost/ghost/persistentvolumeclaim-example-ghost.yaml renamed to package-examples/ghost/ghost-app/persistentvolumeclaim-ghost.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
kind: PersistentVolumeClaim
33
apiVersion: v1
44
metadata:
5-
name: example-ghost
5+
name: ghost-app
66
namespace: example
77
spec:
88
accessModes:

package-examples/ghost/ghost/service-example-ghost.yaml renamed to package-examples/ghost/ghost-app/service-ghost.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
apiVersion: v1
22
kind: Service
33
metadata:
4-
name: example-ghost
4+
name: ghost-app
55
namespace: example
66
spec:
77
type: LoadBalancer

package-examples/ghost/ghost/setlabels.yaml renamed to package-examples/ghost/ghost-app/setlabels.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ metadata:
55
annotations:
66
config.kubernetes.io/local-config: "true"
77
labels:
8-
app.kubernetes.io/name: ghost
9-
app.kubernetes.io/instance: example
10-
app.kubernetes.io/component: ghost
8+
app.kubernetes.io/name: ghost-app
9+
app.kubernetes.io/component: ghost-app

package-examples/ghost/ghost/README.md

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)