Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/lp 1887978 #11847

Merged
merged 5 commits into from Jul 23, 2020
Merged

Feature/lp 1887978 #11847

merged 5 commits into from Jul 23, 2020

Conversation

ycliuhw
Copy link
Member

@ycliuhw ycliuhw commented Jul 21, 2020

Checklist

  • Checked if it requires a pylibjuju change?
  • Added integration tests for the PR?
  • Added or updated doc.go related to packages changed?
  • Do comments answer the question of why design decisions were made?

Description of change

Added a new services field in podspec V3 to allow charms to create extra services;

QA steps

$ yml2json /tmp/charm-builds/mariadb-k8s/reactive/k8s_resources.yaml | jq .kubernetesResources.services
[
  {
    "labels": {
      "foo": "bar"
    },
    "name": "my-service1",
    "spec": {
      "ports": [
        {
          "protocol": "TCP",
          "targetPort": 9376,
          "port": 80
        }
      ],
      "selector": {
        "app": "MyApp"
      }
    }
  },
  {
    "annotations": {
      "cloud.google.com/load-balancer-type": "Internal"
    },
    "labels": {
      "app": "test"
    },
    "spec": {
      "type": "LoadBalancer",
      "ports": [
        {
          "protocol": "TCP",
          "targetPort": 9376,
          "port": 80
        }
      ],
      "selector": {
        "app": "MyApp"
      }
    },
    "name": "my-service2"
  }
]

$ juju deploy /tmp/charm-builds/mariadb-k8s --resource mysql_image=mariadb

$ mkubectl get svc/my-service1 svc/my-service2 -nt1 -o yaml
mkubectl get svc/my-service1 svc/my-service2 -nt1 -o yaml
apiVersion: v1
items:
- apiVersion: v1
  kind: Service
  metadata:
    annotations:
      juju.io/controller: 8a844b9c-3858-4e9b-8f1a-9fdac102abbd
      juju.io/model: 56147af8-a822-49ee-8c28-cddd950d5c8c
    creationTimestamp: "2020-07-21T07:16:33Z"
    labels:
      foo: bar
      juju-app: mariadb-k8s
    name: my-service1
    namespace: t1
    resourceVersion: "169048"
    selfLink: /api/v1/namespaces/t1/services/my-service1
    uid: 54e755a0-0d0e-4401-b022-0e9d823da392
  spec:
    clusterIP: 10.152.183.109
    ports:
    - port: 80
      protocol: TCP
      targetPort: 9376
    selector:
      app: MyApp
    sessionAffinity: None
    type: ClusterIP
  status:
    loadBalancer: {}
- apiVersion: v1
  kind: Service
  metadata:
    annotations:
      cloud.google.com/load-balancer-type: Internal
      juju.io/controller: 8a844b9c-3858-4e9b-8f1a-9fdac102abbd
      juju.io/model: 56147af8-a822-49ee-8c28-cddd950d5c8c
    creationTimestamp: "2020-07-21T07:16:33Z"
    labels:
      app: test
      juju-app: mariadb-k8s
    name: my-service2
    namespace: t1
    resourceVersion: "169054"
    selfLink: /api/v1/namespaces/t1/services/my-service2
    uid: 2a395955-2137-4101-ba8c-99810fa1c95e
  spec:
    clusterIP: 10.152.183.2
    externalTrafficPolicy: Cluster
    ports:
    - nodePort: 30084
      port: 80
      protocol: TCP
      targetPort: 9376
    selector:
      app: MyApp
    sessionAffinity: None
    type: LoadBalancer
  status:
    loadBalancer: {}
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""

Documentation changes

Yes

Bug reference

https://bugs.launchpad.net/juju/+bug/1887978

@ycliuhw ycliuhw requested a review from wallyworld July 21, 2020 07:20
Copy link
Member

@wallyworld wallyworld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

caas/kubernetes/provider/specs/v3.go Show resolved Hide resolved
@hpidcock hpidcock added the 2.8 label Jul 21, 2020
@ycliuhw
Copy link
Member Author

ycliuhw commented Jul 23, 2020

!!build!!

@ycliuhw
Copy link
Member Author

ycliuhw commented Jul 23, 2020

$$merge$$

@jujubot jujubot merged commit 6ae01a4 into juju:2.8 Jul 23, 2020
@ycliuhw ycliuhw deleted the feature/lp-1887978 branch July 23, 2020 06:15
jujubot added a commit that referenced this pull request Jul 24, 2020
#11858

Merge from 2.8 bringing forward:
- #11856 from manadart/2.8-container-lld
- #11847 from ycliuhw/feature/lp-1887978
- #11843 from wallyworld/azure-instancetype-fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants