← harnesscd-example-apps

Add Podinfo GitOps manifests (#38)

29d2f6989a9c287fdde7cc6224b65be5d13df9ec · Nick Lotz · Dec 20, 2023 16:05

+142 · 6 files changed

  • podinfo/deployment.yaml +75 −0
  • podinfo/harness-gitops/application.yml +22 −0
  • podinfo/harness-gitops/cluster.yml +11 −0
  • podinfo/harness-gitops/repository.yml +11 −0
  • podinfo/kustomization.yaml +5 −0
  • podinfo/service.yaml +18 −0
diff --git a/podinfo/deployment.yaml b/podinfo/deployment.yaml
new file mode 100644
index 0000000..93f65dc
--- /dev/null
+++ b/podinfo/deployment.yaml
@@ -0,0 +1,75 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: podinfo
+spec:
+  minReadySeconds: 3
+  revisionHistoryLimit: 5
+  progressDeadlineSeconds: 60
+  strategy:
+    rollingUpdate:
+      maxUnavailable: 0
+    type: RollingUpdate
+  selector:
+    matchLabels:
+      app: podinfo
+  template:
+    metadata:
+      annotations:
+        prometheus.io/scrape: "true"
+        prometheus.io/port: "9797"
+      labels:
+        app: podinfo
+    spec:
+      containers:
+      - name: podinfod
+        image: ghcr.io/stefanprodan/podinfo:6.5.3
+        imagePullPolicy: IfNotPresent
+        ports:
+        - name: http
+          containerPort: 9898
+          protocol: TCP
+        - name: http-metrics
+          containerPort: 9797
+          protocol: TCP
+        - name: grpc
+          containerPort: 9999
+          protocol: TCP
+        command:
+        - ./podinfo
+        - --port=9898
+        - --port-metrics=9797
+        - --grpc-port=9999
+        - --grpc-service-name=podinfo
+        - --level=info
+        - --random-delay=false
+        - --random-error=false
+        env:
+        - name: PODINFO_UI_COLOR
+          value: "#34577c"
+        livenessProbe:
+          exec:
+            command:
+            - podcli
+            - check
+            - http
+            - localhost:9898/healthz
+          initialDelaySeconds: 5
+          timeoutSeconds: 5
+        readinessProbe:
+          exec:
+            command:
+            - podcli
+            - check
+            - http
+            - localhost:9898/readyz
+          initialDelaySeconds: 5
+          timeoutSeconds: 5
+        resources:
+          limits:
+            cpu: 2000m
+            memory: 512Mi
+          requests:
+            cpu: 100m
+            memory: 64Mi
+            
diff --git a/podinfo/harness-gitops/application.yml b/podinfo/harness-gitops/application.yml
new file mode 100644
index 0000000..5f19a59
--- /dev/null
+++ b/podinfo/harness-gitops/application.yml
@@ -0,0 +1,22 @@
+gitops:
+  name: gitops-application
+  projectIdentifier: default_project
+  orgIdentifier: default
+  type: application
+  application:
+    metadata:
+      clusterName: gitops_cluster
+      labels:
+        harness.io/serviceRef: harnesspodinfo
+        harness.io/envRef: harnessdevenv
+    spec:
+      source:
+        repoURL: https://github.com/harness-community/harnesscd-example-apps
+        path: podinfo
+        targetRevision: master
+      destination:
+        server: https://kubernetes.default.svc
+        namespace: default
+  agentIdentifier: AGENT_NAME
+  clusterIdentifier: gitopscluster
+  repoIdentifier: gitopsrepo
diff --git a/podinfo/harness-gitops/cluster.yml b/podinfo/harness-gitops/cluster.yml
new file mode 100644
index 0000000..8638b84
--- /dev/null
+++ b/podinfo/harness-gitops/cluster.yml
@@ -0,0 +1,11 @@
+gitops:
+  name: gitops_cluster
+  identifier: gitopscluster
+  projectIdentifier: default_project
+  orgIdentifier: default
+  type: cluster
+  cluster:
+    server: https://kubernetes.default.svc
+    config:
+      clusterConnectionType: IN_CLUSTER
+  agentIdentifier: AGENT_NAME
\ No newline at end of file
diff --git a/podinfo/harness-gitops/repository.yml b/podinfo/harness-gitops/repository.yml
new file mode 100644
index 0000000..04ab77f
--- /dev/null
+++ b/podinfo/harness-gitops/repository.yml
@@ -0,0 +1,11 @@
+gitops:
+    name: gitops_repo
+    identifier: gitopsrepo
+    projectIdentifier: default_project
+    orgIdentifier: default
+    type: repository
+    repo:
+        repo: https://github.com/harness-community/harnesscd-example-apps
+        type: git
+        connectionType: HTTPS_ANONYMOUS
+    agentIdentifier: AGENT_NAME
\ No newline at end of file
diff --git a/podinfo/kustomization.yaml b/podinfo/kustomization.yaml
new file mode 100644
index 0000000..a33121c
--- /dev/null
+++ b/podinfo/kustomization.yaml
@@ -0,0 +1,5 @@
+apiVersion: kustomize.config.k8s.io/v1beta1
+kind: Kustomization
+resources:
+  - deployment.yaml
+  - service.yaml
diff --git a/podinfo/service.yaml b/podinfo/service.yaml
new file mode 100644
index 0000000..1daab9f
--- /dev/null
+++ b/podinfo/service.yaml
@@ -0,0 +1,18 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: podinfo
+spec:
+  type: ClusterIP
+  selector:
+    app: podinfo
+  ports:
+    - name: http
+      port: 9898
+      protocol: TCP
+      targetPort: http
+    - port: 9999
+      targetPort: grpc
+      protocol: TCP
+      name: grpc
+