Last active
November 29, 2019 07:31
-
-
Save Skarlso/182e57d362e7ae93d6b456d46b5fba66 to your computer and use it in GitHub Desktop.
Service Files for Kubernetes to deploy Athens -- Assumes cert-manager is installed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| namespace: athens | |
| name: athens-app | |
| labels: | |
| app: athens | |
| spec: | |
| replicas: 1 | |
| selector: | |
| matchLabels: | |
| app: athens | |
| template: | |
| metadata: | |
| labels: | |
| app: athens | |
| app.kubernetes.io/name: athens | |
| app.kubernetes.io/instance: athens | |
| spec: | |
| containers: | |
| - name: athens | |
| image: gomods/athens:v0.5.0 | |
| livenessProbe: | |
| httpGet: | |
| path: "/healthz" | |
| port: 3000 | |
| readinessProbe: | |
| httpGet: | |
| path: "/readyz" | |
| port: 3000 | |
| env: | |
| - name: ATHENS_GOGET_WORKERS | |
| value: "3" | |
| - name: ATHENS_STORAGE_TYPE | |
| value: "disk" | |
| - name: ATHENS_DISK_STORAGE_ROOT | |
| value: /var/lib/athens | |
| ports: | |
| - containerPort: 3000 | |
| name: athens-http | |
| volumeMounts: | |
| - name: athens-data | |
| mountPath: /var/lib/athens | |
| subPath: athens | |
| volumes: | |
| - name: athens-data | |
| persistentVolumeClaim: | |
| claimName: athens-storage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: extensions/v1beta1 | |
| kind: Ingress | |
| metadata: | |
| namespace: athens | |
| name: athens-ingress | |
| annotations: | |
| kubernetes.io/ingress.class: "nginx" | |
| certmanager.k8s.io/cluster-issuer: "letsencrypt-prod" | |
| certmanager.k8s.io/acme-challenge-type: http01 | |
| nginx.ingress.kubernetes.io/rewrite-target: / | |
| spec: | |
| tls: | |
| - hosts: | |
| - athens.example.org | |
| secretName: athens-tls | |
| rules: | |
| - host: athens.example.org | |
| http: | |
| paths: | |
| - backend: | |
| serviceName: athens | |
| servicePort: 80 | |
| path: / |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: Service | |
| metadata: | |
| labels: | |
| app: nginx-ingress | |
| release: nginx-ingress | |
| name: nginx-ingress-controller | |
| namespace: default | |
| spec: | |
| externalTrafficPolicy: Cluster | |
| ports: | |
| - name: https | |
| port: 443 | |
| protocol: TCP | |
| targetPort: https | |
| - name: http | |
| port: 80 | |
| protocol: TCP | |
| targetPort: 80 | |
| selector: | |
| app: nginx-ingress | |
| component: controller | |
| release: nginx-ingress | |
| sessionAffinity: None | |
| type: LoadBalancer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: v1 | |
| kind: PersistentVolumeClaim | |
| metadata: | |
| namespace: athens | |
| name: athens-storage | |
| spec: | |
| accessModes: | |
| - ReadWriteOnce | |
| resources: | |
| requests: | |
| storage: 10Gi | |
| storageClassName: do-block-storage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| kind: Service | |
| apiVersion: v1 | |
| metadata: | |
| namespace: athens | |
| name: athens | |
| labels: | |
| app: athens | |
| app.kubernetes.io/name: athens | |
| app.kubernetes.io/instance: athens | |
| spec: | |
| selector: | |
| app: athens | |
| app.kubernetes.io/name: athens | |
| app.kubernetes.io/instance: athens | |
| ports: | |
| - port: 80 | |
| targetPort: 3000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: certmanager.k8s.io/v1alpha1 | |
| kind: ClusterIssuer | |
| metadata: | |
| name: letsencrypt-prod | |
| spec: | |
| acme: | |
| # The ACME server URL | |
| server: https://acme-v02.api.letsencrypt.org/directory | |
| # Email address used for ACME registration | |
| email: [email protected] | |
| # Name of a secret used to store the ACME account private key | |
| privateKeySecretRef: | |
| name: letsencrypt-prod | |
| # Enable the HTTP-01 challenge provider | |
| http01: {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment